[FFmpeg-cvslog] Check extradata size on resolution change.

Reimar Döffinger git at videolan.org
Thu Nov 3 03:57:38 CET 2011


ffmpeg | branch: release/0.5 | Reimar Döffinger <Reimar.Doeffinger at gmx.de> | Sun Jul 17 15:22:36 2011 +0200| [4e0315b30ecb41b6fa349fba0d8eb1adaa4fe3bc] | committer: Michael Niedermayer

Check extradata size on resolution change.

Ignore resolution change if resolution not defined in extradata.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger at gmx.de>
(cherry picked from commit 09c5f990bc7629dfbee8c760fd485936c60a7b40)

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4e0315b30ecb41b6fa349fba0d8eb1adaa4fe3bc
---

 libavcodec/rv30.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/libavcodec/rv30.c b/libavcodec/rv30.c
index e1b3ad1..a2dc57e 100644
--- a/libavcodec/rv30.c
+++ b/libavcodec/rv30.c
@@ -51,6 +51,11 @@ static int rv30_parse_slice_header(RV34DecContext *r, GetBitContext *gb, SliceIn
     skip_bits1(gb);
     si->pts = get_bits(gb, 13);
     rpr = get_bits(gb, r->rpr);
+    if (r->s.avctx->extradata_size < 8 + rpr*2) {
+        av_log(r->s.avctx, AV_LOG_WARNING,
+               "Extradata does not contain selected resolution\n");
+        rpr = 0;
+    }
     if(rpr){
         w = r->s.avctx->extradata[6 + rpr*2] << 2;
         h = r->s.avctx->extradata[7 + rpr*2] << 2;



More information about the ffmpeg-cvslog mailing list