Commit 20df0268 authored by Michael Niedermayer's avatar Michael Niedermayer

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: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent bec077a1
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment