Browse code

validate streamid before use

Originally committed as revision 11427 to svn://svn.ffmpeg.org/ffmpeg/trunk

Ivo van Poorten authored on 2008/01/06 07:18:44
Showing 1 changed files
... ...
@@ -79,6 +79,10 @@ static int pva_read_packet(AVFormatContext *s, AVPacket *pkt) {
79 79
         av_log(s, AV_LOG_ERROR, "invalid syncword\n");
80 80
         return AVERROR(EIO);
81 81
     }
82
+    if (streamid != PVA_VIDEO_PAYLOAD && streamid != PVA_AUDIO_PAYLOAD) {
83
+        av_log(s, AV_LOG_ERROR, "invalid streamid\n");
84
+        return AVERROR(EIO);
85
+    }
82 86
     if (reserved != 0x55) {
83 87
         av_log(s, AV_LOG_WARNING, "expected reserved byte to be 0x55\n");
84 88
     }