java - Android: Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1) on movie.draw -
i trying display animated gif in imageview using android movie class in ondraw method follow:
@override protected void ondraw(canvas canvas) { canvas.drawcolor(color.transparent); super.ondraw(canvas); long = android.os.systemclock.uptimemillis(); if (moviestart == 0) { moviestart = now; } movie = getmoviefromgif(); if (movie != null && movie.duration() > 0) { try { int reltime = (int) ((now - moviestart) % movie.duration()); movie.settime(reltime); float movie_height = convertdptopixels(movie.height()); float movie_width = convertdptopixels(movie.width()); float new_movie_height = movie_height; float new_movie_width = movie_width; float movie_ratio = movie_width / movie_height; if (new_movie_width > container_width) { new_movie_width = container_width; new_movie_height = new_movie_width / movie_ratio; } if (new_movie_height > container_height) { new_movie_height = container_height; new_movie_width = new_movie_height * movie_ratio; } float scale_x = container_width / new_movie_width; float scale_y = container_height / new_movie_height; scale_x = new_movie_width / (float) movie.width(); scale_y = new_movie_height / (float) movie.height(); canvas.scale(scale_x, scale_y); float x = 0; if ((float) this.getwidth() > new_movie_width) { x = ((this.getwidth() - (movie.width() * scale_x)) / 2f) / scale_x; } movie.draw(canvas, x, 0); this.invalidate(); } catch (exception ex) { log.i("ondraw()", "error: " + ex.getmessage()); } } }
code runs fine on devices on huawei ascend p7 , samsung galaxy a5, application crashes on movie.draw(canvas, x, 0) exception:
a/libc(23632): fatal signal 11 (sigsegv) @ 0x00000000 (code=1), thread 23632
any idea wrong movie.draw on these devices?
updated: following complete stack trace
04-29 12:09:24.979: d/activity(18951): #2 settransgradationmodecolor true
04-29 12:09:25.049: i/adreno-egl(18951): : egl 1.4 qualcomm build: ()
04-29 12:09:25.049: i/adreno-egl(18951): opengl es shader compiler version: e031.24.02.07
04-29 12:09:25.049: i/adreno-egl(18951): build date: 08/06/14 wed
04-29 12:09:25.049: i/adreno-egl(18951): local branch: rb1
04-29 12:09:25.049: i/adreno-egl(18951): remote branch:
04-29 12:09:25.049: i/adreno-egl(18951): local patches:
04-29 12:09:25.049: i/adreno-egl(18951): reconstruct branch:
04-29 12:09:25.079: d/openglrenderer(18951): enabling debug mode 0
04-29 12:09:25.109: d/skia(18951): streamtobyte : input agif image larger 30mb.
04-29 12:09:25.109: d/skia(18951): streamtobyte : quram agif - length : 10473
04-29 12:09:25.109: d/skia(18951): wink agif move constructer end 9, totaltime : 2700
04-29 12:09:25.109: a/libc(18951): fatal signal 11 (sigsegv) @ 0x00000000 (code=1), thread 18951 (com.android.gif)
fatal signal error occurs after execution of code movie.draw(), rest stack trace of execution of lines before movie.draw().
i able resolve issue disabling android hardware acceleration:
android:hardwareaccelerated="false"