You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
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>
This commit is contained in:
@@ -858,7 +858,7 @@ void ff_er_add_slice(ERContext *s, int startx, int starty,
|
|||||||
|
|
||||||
void ff_er_frame_end(ERContext *s)
|
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 i, mb_x, mb_y, error, error_type, dc_error, mv_error, ac_error;
|
||||||
int distance;
|
int distance;
|
||||||
int threshold_part[4] = { 100, 100, 100 };
|
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)) {
|
(s->avctx->skip_top + s->avctx->skip_bottom)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
linesize = s->cur_pic.f->linesize;
|
||||||
for (mb_x = 0; mb_x < s->mb_width; mb_x++) {
|
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];
|
int status = s->error_status_table[mb_x + (s->mb_height - 1) * s->mb_stride];
|
||||||
if (status != 0x7F)
|
if (status != 0x7F)
|
||||||
|
Reference in New Issue
Block a user