[vlc-devel] [vlc-commits] picture_Hold: add an assertion
Thomas Guillem
thomas at gllm.fr
Fri Oct 31 10:59:54 CET 2014
On Thu, Oct 30, 2014, at 20:02, Rémi Denis-Courmont wrote:
> vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Oct 30
> 21:02:43 2014 +0200| [c2b0f25eab8debf0f9d437dbeb298368692dddc6] |
> committer: Rémi Denis-Courmont
>
> picture_Hold: add an assertion
>
> > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c2b0f25eab8debf0f9d437dbeb298368692dddc6
> ---
>
> src/misc/picture.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/misc/picture.c b/src/misc/picture.c
> index 358de65..6aa5b05 100644
> --- a/src/misc/picture.c
> +++ b/src/misc/picture.c
> @@ -284,7 +284,8 @@ picture_t *picture_New( vlc_fourcc_t i_chroma, int
> i_width, int i_height, int i_
>
> picture_t *picture_Hold( picture_t *p_picture )
> {
> - atomic_fetch_add( &p_picture->gc.refcount, 1 );
> + uintptr_t refs = atomic_fetch_add( &p_picture->gc.refcount, 1 );
> + assert( refs > 0 );
> return p_picture;
> }
>
this patch breaks avcodec in android, SIGABRT due to an assert:
Program received signal SIGABRT, Aborted.
[Switching to Thread 9289]
0x40131f78 in tgkill () from
/home/tom/work/git/vlc-android/vlc-android/obj/local/armeabi-v7a/libc.so
(gdb) bt
#0 0x40131f78 in tgkill () from
/home/tom/work/git/vlc-android/vlc-android/obj/local/armeabi-v7a/libc.so
#1 0x40123010 in pthread_kill () from
/home/tom/work/git/vlc-android/vlc-android/obj/local/armeabi-v7a/libc.so
#2 0x40123224 in raise () from
/home/tom/work/git/vlc-android/vlc-android/obj/local/armeabi-v7a/libc.so
#3 0x40121f5a in ?? () from
/home/tom/work/git/vlc-android/vlc-android/obj/local/armeabi-v7a/libc.so
#4 0x40131830 in abort () from
/home/tom/work/git/vlc-android/vlc-android/obj/local/armeabi-v7a/libc.so
#5 0x40122a40 in ?? () from
/home/tom/work/git/vlc-android/vlc-android/obj/local/armeabi-v7a/libc.so
#6 0x40121fb8 in __assert2 () from
/home/tom/work/git/vlc-android/vlc-android/obj/local/armeabi-v7a/libc.so
#7 0x75652196 in picture_Hold (p_picture=0x75d8b620 <__func__.8221>,
p_picture at entry=0x77fa8d98) at ../../src/misc/picture.c:288
#8 0x75653064 in picture_pool_Get (pool=0x75cf44dc) at
../../src/misc/picture_pool.c:284
#9 0x75640f24 in vout_GetPicture (vout=0x77e9ace4) at
../../src/video_output/video_output.c:424
#10 0x7562e46e in vout_new_buffer (p_dec=0x780e096c) at
../../src/input/decoder.c:2176
#11 0x7562e99a in decoder_NewPicture
(p_decoder=p_decoder at entry=0x780e096c) at ../../src/input/decoder.c:167
#12 0x755e0af8 in ffmpeg_NewPictBuf (p_context=0x766f7500,
p_dec=0x780e096c) at ../../modules/codec/avcodec/video.c:196
#13 lavc_dr_GetFrame (flags=1, frame=0x79f967e0, ctx=0x766f7500) at
../../modules/codec/avcodec/video.c:1024
#14 lavc_GetFrame (ctx=0x766f7500, frame=0x79f967e0, flags=1) at
../../modules/codec/avcodec/video.c:1123
#15 0x7591be9a in ff_get_buffer (avctx=avctx at entry=0x766f7500,
frame=0x79f967e0, flags=flags at entry=1) at libavcodec/utils.c:797
#16 0x758cc152 in ff_thread_get_buffer (avctx=0x766f7500,
f=f at entry=0x79f96990, flags=1) at libavcodec/pthread_frame.c:725
#17 0x757e8722 in alloc_picture (pic=0x79f967e0, h=0x7683c020) at
libavcodec/h264_slice.c:251
#18 h264_frame_start (h=h at entry=0x7683c020) at
libavcodec/h264_slice.c:696
#19 0x757eac04 in ff_h264_decode_slice_header (h=h at entry=0x7683c020,
h0=h0 at entry=0x7683c020) at libavcodec/h264_slice.c:1551
#20 0x757c724a in decode_nal_units (parse_extradata=0,
buf_size=<optimized out>, buf=0x7a1d7008 "", h=0x7683c020) at
libavcodec/h264.c:1520
#21 h264_decode_frame (avctx=0x766f7500, data=0x77db8b60,
got_frame=0x7681cefc, avpkt=<optimized out>) at libavcodec/h264.c:1775
#22 0x758cb840 in frame_worker_thread (arg=0x7681ce80) at
libavcodec/pthread_frame.c:145
#23 0x4011d1b4 in __thread_entry () from
/home/tom/work/git/vlc-android/vlc-android/obj/local/armeabi-v7a/libc.so
#24 0x4011d34c in pthread_create () from
/home/tom/work/git/vlc-android/vlc-android/obj/local/armeabi-v7a/libc.so
>
> _______________________________________________
> vlc-commits mailing list
> vlc-commits at videolan.org
> https://mailman.videolan.org/listinfo/vlc-commits
More information about the vlc-devel
mailing list