aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2012-06-21 12:09:01 +0000
committerPaul B Mahol <onemda@gmail.com>2012-06-21 12:14:53 +0000
commit3821632e1ba3cae5a66580b319d772d1e51bd60e (patch)
treea861309663d26224fcb3d5a0a21e54509401973c
parent1bb30d02959e530c72a0026047cb916883c031a7 (diff)
downloadffmpeg-3821632e1ba3cae5a66580b319d772d1e51bd60e.tar.gz
smush: set audio packet duration
Signed-off-by: Paul B Mahol <onemda@gmail.com>
-rw-r--r--libavformat/smush.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/smush.c b/libavformat/smush.c
index 4d3e1380e4..d884cfe9cd 100644
--- a/libavformat/smush.c
+++ b/libavformat/smush.c
@@ -207,10 +207,15 @@ static int smush_read_packet(AVFormatContext *ctx, AVPacket *pkt)
done = 1;
break;
case MKBETAG('W', 'a', 'v', 'e'):
+ if (size < 13)
+ return AVERROR_INVALIDDATA;
if (av_get_packet(pb, pkt, size) < 0)
return AVERROR(EIO);
pkt->stream_index = smush->audio_stream_index;
+ pkt->duration = AV_RB32(pkt->data);
+ if (pkt->duration == 0xFFFFFFFFu)
+ pkt->duration = AV_RB32(pkt->data + 8);
done = 1;
break;
default: