smush: set audio packet duration
authorPaul B Mahol <onemda@gmail.com>
Thu, 21 Jun 2012 12:09:01 +0000 (12:09 +0000)
committerPaul B Mahol <onemda@gmail.com>
Thu, 21 Jun 2012 12:14:53 +0000 (12:14 +0000)
Signed-off-by: Paul B Mahol <onemda@gmail.com>
libavformat/smush.c

index 4d3e138..d884cfe 100644 (file)
@@ -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: