diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 372adb931b..5339ed017e 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -3792,7 +3792,8 @@ static int decode_slice_header(H264Context *h, H264Context *h0){ while(h->frame_num != h->prev_frame_num && h->frame_num != (h->prev_frame_num+1)%(1<sps.log2_max_frame_num)){ av_log(NULL, AV_LOG_DEBUG, "Frame num gap %d %d\n", h->frame_num, h->prev_frame_num); - frame_start(h); + if (frame_start(h) < 0) + return -1; h->prev_frame_num++; h->prev_frame_num %= 1<sps.log2_max_frame_num; s->current_picture_ptr->frame_num= h->prev_frame_num;