validate streamid before use
authorIvo van Poorten <ivop@euronet.nl>
Sat, 5 Jan 2008 22:18:44 +0000 (22:18 +0000)
committerIvo van Poorten <ivop@euronet.nl>
Sat, 5 Jan 2008 22:18:44 +0000 (22:18 +0000)
Originally committed as revision 11427 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/pva.c

index f819b83..760f7fc 100644 (file)
@@ -79,6 +79,10 @@ static int pva_read_packet(AVFormatContext *s, AVPacket *pkt) {
         av_log(s, AV_LOG_ERROR, "invalid syncword\n");
         return AVERROR(EIO);
     }
+    if (streamid != PVA_VIDEO_PAYLOAD && streamid != PVA_AUDIO_PAYLOAD) {
+        av_log(s, AV_LOG_ERROR, "invalid streamid\n");
+        return AVERROR(EIO);
+    }
     if (reserved != 0x55) {
         av_log(s, AV_LOG_WARNING, "expected reserved byte to be 0x55\n");
     }