Avoid crash if there is a rtjpeg quant header but no video stream in file
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>
Thu, 20 Apr 2006 10:38:15 +0000 (10:38 +0000)
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>
Thu, 20 Apr 2006 10:38:15 +0000 (10:38 +0000)
Originally committed as revision 5305 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/nuv.c

index 04bae8f..e707854 100644 (file)
@@ -65,7 +65,7 @@ static int get_codec_data(ByteIOContext *pb, AVStream *vst,
                 subtype = get_byte(pb);
                 url_fskip(pb, 6);
                 size = PKTSIZE(get_le32(pb));
-                if (subtype == 'R') {
+                if (vst && subtype == 'R') {
                     vst->codec->extradata_size = size;
                     vst->codec->extradata = av_malloc(size);
                     get_buffer(pb, vst->codec->extradata, size);