[FFmpeg-cvslog] asfdec: check stream_index for validity

Michael Niedermayer git at videolan.org
Tue Dec 11 00:00:01 CET 2012


ffmpeg | branch: release/1.0 | Michael Niedermayer <michaelni at gmx.at> | Sat Nov  3 05:58:12 2012 +0100| [41bcde6021272fd82deb46da102c4971c90e662f] | committer: Carl Eugen Hoyos

asfdec: check stream_index for validity

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit b7280cff9a7683395d7f899517b4aea8b52f12a4)

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

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

 libavformat/asfdec.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c
index 8509008..20f212f 100644
--- a/libavformat/asfdec.c
+++ b/libavformat/asfdec.c
@@ -972,7 +972,7 @@ static int asf_read_frame_header(AVFormatContext *s, AVIOContext *pb){
             case 0x54:
                 aspect.num = avio_r8(pb);
                 aspect.den = avio_r8(pb);
-                if (aspect.num > 0 && aspect.den > 0) {
+                if (aspect.num > 0 && aspect.den > 0 && asf->stream_index >= 0) {
                     s->streams[asf->stream_index]->sample_aspect_ratio = aspect;
                 }
                 break;



More information about the ffmpeg-cvslog mailing list