[FFmpeg-cvslog] avcodec/wmaprodec: do not force extradata presence for XMA

Paul B Mahol git at videolan.org
Wed Jan 11 12:49:09 EET 2017


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Wed Jan 11 11:38:56 2017 +0100| [107b3064d8bf783c64f488f17c1f485dd72653e7] | committer: Paul B Mahol

avcodec/wmaprodec: do not force extradata presence for XMA

Mainly useful for supporting decoding of headerless files.

Signed-off-by: Paul B Mahol <onemda at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=107b3064d8bf783c64f488f17c1f485dd72653e7
---

 libavcodec/wmaprodec.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c
index d06e3b7..105e279 100644
--- a/libavcodec/wmaprodec.c
+++ b/libavcodec/wmaprodec.c
@@ -322,12 +322,12 @@ static av_cold int decode_init(AVCodecContext *avctx)
     for (i = 0; i < avctx->extradata_size; i++)
         av_log(avctx, AV_LOG_DEBUG, "[%x] ", avctx->extradata[i]);
     av_log(avctx, AV_LOG_DEBUG, "\n");
-    if (avctx->codec_id == AV_CODEC_ID_XMA2 && avctx->extradata_size >= 34) {
+    if (avctx->codec_id == AV_CODEC_ID_XMA2 && (!avctx->extradata || avctx->extradata_size >= 6)) {
         s->decode_flags    = 0x10d6;
-        channel_mask       = AV_RL32(edata_ptr+2);
+        channel_mask       = avctx->extradata ? AV_RL32(edata_ptr+2) : 0;
         s->bits_per_sample = 16;
 
-     } else if (avctx->codec_id == AV_CODEC_ID_XMA1 && avctx->extradata_size >= 28) {
+     } else if (avctx->codec_id == AV_CODEC_ID_XMA1) {
         s->decode_flags    = 0x10d6;
         s->bits_per_sample = 16;
         channel_mask       = 0;



More information about the ffmpeg-cvslog mailing list