blob: 8eef6e99cc0116335a82175e010e843ca133a799 [file] [log] [blame]
Patrick Williamsb48b7b42016-08-17 15:04:38 -05001gst-ffmpeg: error_concealment: Check that the picture is not in a half
2
3Fixes state becoming inconsistent
4Fixes a null pointer dereference
5
6Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
7Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
8(cherry picked from commit 23318a57358358e7a4dc551e830e4503f0638cfe)
9
10Upstream-Status: Backport
11
12Signed-off-by: Yue Tao <yue.tao@windriver.com>
13
14---
15 libavcodec/error_resilience.c | 6 ++++++
16 1 files changed, 6 insertions(+), 0 deletions(-)
17
18diff --git a/libavcodec/error_resilience.c b/libavcodec/error_resilience.c
19index 01f7424..2b6bc42 100644
20--- a/gst-libs/ext/libav/libavcodec/error_resilience.c
21+++ b/gst-libs/ext/libav/libavcodec/error_resilience.c
22@@ -793,6 +793,12 @@ void ff_er_frame_end(MpegEncContext *s){
23 s->picture_structure != PICT_FRAME || // we dont support ER of field pictures yet, though it should not crash if enabled
24 s->error_count==3*s->mb_width*(s->avctx->skip_top + s->avctx->skip_bottom)) return;
25
26+ if ( s->picture_structure == PICT_FRAME
27+ && s->current_picture.linesize[0] != s->current_picture_ptr->linesize[0]) {
28+ av_log(s->avctx, AV_LOG_ERROR, "Error concealment not possible, frame not fully initialized\n");
29+ return;
30+ }
31+
32 if(s->current_picture.motion_val[0] == NULL){
33 av_log(s->avctx, AV_LOG_ERROR, "Warning MVs not available\n");
34
35--
361.7.5.4
37