aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2011-10-19 18:41:02 +0200
committerMartin Storsjö <martin@martin.st>2011-10-22 00:59:33 +0300
commitf4b51d061f0f34e36be876b562b8abe47f4b9c1c (patch)
treeec75e5401f8cd370fb7ccedb8502ed92be439423
parentb19e0c2b4e74349d3b362e48c57eb233f1880b28 (diff)
downloadffmpeg-f4b51d061f0f34e36be876b562b8abe47f4b9c1c.tar.gz
flvdec: Do not call parse_keyframes_index with a NULL stream
Signed-off-by: Martin Storsjö <martin@martin.st>
-rw-r--r--libavformat/flvdec.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index 395c8f8a57..1459850f4a 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -239,8 +239,9 @@ static int amf_parse_object(AVFormatContext *s, AVStream *astream, AVStream *vst
case AMF_DATA_TYPE_OBJECT: {
unsigned int keylen;
- if (key && !strcmp(KEYFRAMES_TAG, key) && depth == 1)
- if (parse_keyframes_index(s, ioc, vstream, max_pos) < 0)
+ if ((vstream || astream) && key && !strcmp(KEYFRAMES_TAG, key) && depth == 1)
+ if (parse_keyframes_index(s, ioc, vstream ? vstream : astream,
+ max_pos) < 0)
return -1;
while(avio_tell(ioc) < max_pos - 2 && (keylen = avio_rb16(ioc))) {