diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-10-12 04:46:55 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-10-12 04:49:08 +0200 |
commit | 20df02680c94df1dd74f2e69068cbf02cb98d290 (patch) | |
tree | 974ff3c798af1e69f895a0015918a1bc0759f14d | |
parent | bec077a1ab1fe19d8cb7a9cafd9731546d449c4b (diff) | |
download | ffmpeg-20df02680c94df1dd74f2e69068cbf02cb98d290.tar.gz |
avcodec/error_resilience: avoid pointer arithmetic with NULL
move the code after the existing NULL check
Fixes: signal_sigsegv_844d59_10_signal_sigsegv_a17bb7_366_mpegts_mpeg2video_mp2_dvbsub_topfield.rec
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/error_resilience.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/error_resilience.c b/libavcodec/error_resilience.c index 2ba4a68a98..26117805e4 100644 --- a/libavcodec/error_resilience.c +++ b/libavcodec/error_resilience.c @@ -858,7 +858,7 @@ void ff_er_add_slice(ERContext *s, int startx, int starty, void ff_er_frame_end(ERContext *s) { - int *linesize = s->cur_pic.f->linesize; + int *linesize = NULL; int i, mb_x, mb_y, error, error_type, dc_error, mv_error, ac_error; int distance; int threshold_part[4] = { 100, 100, 100 }; @@ -875,6 +875,7 @@ void ff_er_frame_end(ERContext *s) (s->avctx->skip_top + s->avctx->skip_bottom)) { return; } + linesize = s->cur_pic.f->linesize; for (mb_x = 0; mb_x < s->mb_width; mb_x++) { int status = s->error_status_table[mb_x + (s->mb_height - 1) * s->mb_stride]; if (status != 0x7F) |