ffmpeg | branch: master | James Almer <jamr...@gmail.com> | Wed Nov 1 14:07:48 2017 -0300| [a33a15751e274bf9c52a80602531fa3b9c90a9d1] | committer: James Almer
Merge commit 'b98f082d8ddc0a0d8317114d8414ab51de60ef02' * commit 'b98f082d8ddc0a0d8317114d8414ab51de60ef02': smacker: Check that the data size is a multiple of a sample vector See 4a9af07a49295e014b059c1ab624c40345af5892 Merged-by: James Almer <jamr...@gmail.com> > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a33a15751e274bf9c52a80602531fa3b9c90a9d1 --- libavcodec/smacker.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/smacker.c b/libavcodec/smacker.c index 2d20be9c10..3a7067e7d5 100644 --- a/libavcodec/smacker.c +++ b/libavcodec/smacker.c @@ -662,7 +662,8 @@ static int smka_decode_frame(AVCodecContext *avctx, void *data, /* get output buffer */ frame->nb_samples = unp_size / (avctx->channels * (bits + 1)); if (unp_size % (avctx->channels * (bits + 1))) { - av_log(avctx, AV_LOG_ERROR, "unp_size %d is odd\n", unp_size); + av_log(avctx, AV_LOG_ERROR, + "The buffer does not contain an integer number of samples\n"); return AVERROR(EINVAL); } if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) ====================================================================== diff --cc libavcodec/smacker.c index 2d20be9c10,d42347ccdc..3a7067e7d5 --- a/libavcodec/smacker.c +++ b/libavcodec/smacker.c @@@ -658,15 -636,18 +658,16 @@@ static int smka_decode_frame(AVCodecCon av_log(avctx, AV_LOG_ERROR, "sample format mismatch\n"); return AVERROR(EINVAL); } + + /* get output buffer */ + frame->nb_samples = unp_size / (avctx->channels * (bits + 1)); if (unp_size % (avctx->channels * (bits + 1))) { - av_log(avctx, AV_LOG_ERROR, "unp_size %d is odd\n", unp_size); + av_log(avctx, AV_LOG_ERROR, + "The buffer does not contain an integer number of samples\n"); return AVERROR(EINVAL); } - - /* get output buffer */ - frame->nb_samples = unp_size / (avctx->channels * (bits + 1)); - if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) { - av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); + if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) return ret; - } samples = (int16_t *)frame->data[0]; samples8 = frame->data[0]; _______________________________________________ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog