]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/wmadec.c
Only store timestamps when there are timestamps.
[ffmpeg] / libavcodec / wmadec.c
index 1573e5d7838f70b2c4f05da8f200fc657867d22b..e622b238d6d6a8f3ad2cc28fe2fc7eb5ce82593f 100644 (file)
@@ -755,7 +755,7 @@ static int wma_decode_frame(WMACodecContext *s, int16_t *samples)
 
 static int wma_decode_superframe(AVCodecContext *avctx,
                                  void *data, int *data_size,
-                                 uint8_t *buf, int buf_size)
+                                 const uint8_t *buf, int buf_size)
 {
     WMACodecContext *s = avctx->priv_data;
     int nb_frames, bit_offset, i, pos, len;
@@ -768,6 +768,9 @@ static int wma_decode_superframe(AVCodecContext *avctx,
         s->last_superframe_len = 0;
         return 0;
     }
+    if (buf_size < s->block_align)
+        return 0;
+    buf_size = s->block_align;
 
     samples = data;
 
@@ -859,6 +862,7 @@ AVCodec wmav1_decoder =
     NULL,
     ff_wma_end,
     wma_decode_superframe,
+    .long_name = "Windows Media Audio 1",
 };
 
 AVCodec wmav2_decoder =
@@ -871,4 +875,5 @@ AVCodec wmav2_decoder =
     NULL,
     ff_wma_end,
     wma_decode_superframe,
+    .long_name = "Windows Media Audio 2",
 };