summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-08-06 18:19:57 +0100
committerAnton Khirnov <anton@khirnov.net>2014-08-06 19:25:56 +0000
commit52254067b312e78d30bbe79fc33dbdf995b22b4e (patch)
tree53a766f21367511473b54508bef3387114887e75
parentaf9b62654d5aa023a96906215365532d18541a09 (diff)
downloadffmpeg-52254067b312e78d30bbe79fc33dbdf995b22b4e.tar.gz
error_concealment: avoid using the picture if not fully setup
Fixes state becoming inconsistent and a null pointer dereference. CC: libav-stable@libav.org Bug-Id: CVE-2013-0860 Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
-rw-r--r--libavcodec/error_resilience.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/error_resilience.c b/libavcodec/error_resilience.c
index ae9ef68617..73b69aff75 100644
--- a/libavcodec/error_resilience.c
+++ b/libavcodec/error_resilience.c
@@ -896,6 +896,12 @@ void ff_er_frame_end(MpegEncContext *s)
return;
};
+ if (s->picture_structure == PICT_FRAME &&
+ s->current_picture.f.linesize[0] != s->current_picture_ptr->f.linesize[0]) {
+ av_log(s->avctx, AV_LOG_ERROR, "Error concealment not possible, frame not fully initialized\n");
+ return;
+ }
+
if (s->current_picture.f.motion_val[0] == NULL) {
av_log(s->avctx, AV_LOG_ERROR, "Warning MVs not available\n");