From 7705cf7e1515d56e811a8d92eee65f7969e5fba8 Mon Sep 17 00:00:00 2001
From: Ivo van Poorten <ivop@euronet.nl>
Date: Sat, 5 Jan 2008 22:18:44 +0000
Subject: [PATCH] validate streamid before use

Originally committed as revision 11427 to svn://svn.ffmpeg.org/ffmpeg/trunk
---
 libavformat/pva.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavformat/pva.c b/libavformat/pva.c
index f819b832d1f..760f7fc90e7 100644
--- a/libavformat/pva.c
+++ b/libavformat/pva.c
@@ -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");
     }
-- 
GitLab