[FFmpeg-cvslog] avidec: Fix use of stream_index before validation of its range.

Michael Niedermayer git at videolan.org
Mon Jan 23 19:50:26 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon Jan 23 19:36:22 2012 +0100| [14d94a19522c6710c95928bfd73064cf197214a8] | committer: Michael Niedermayer

avidec: Fix use of stream_index before validation of its range.

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavformat/avidec.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index cac760e..86121b4 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -699,8 +699,7 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)
             }
             break;
         case MKTAG('s', 't', 'r', 'd'):
-            st = s->streams[stream_index];
-            if (stream_index >= (unsigned)s->nb_streams || st->codec->extradata_size) {
+            if (stream_index >= (unsigned)s->nb_streams || s->streams[stream_index]->codec->extradata_size) {
                 avio_skip(pb, size);
             } else {
                 uint64_t cur_pos = avio_tell(pb);



More information about the ffmpeg-cvslog mailing list