projects
/
platform
/
upstream
/
libav.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
512557b
)
mpegaudiodec: check output data size based on avctx->frame_size
author
Justin Ruggles
<justin.ruggles@gmail.com>
Tue, 27 Sep 2011 18:27:43 +0000
(14:27 -0400)
committer
Justin Ruggles
<justin.ruggles@gmail.com>
Fri, 28 Oct 2011 02:06:32 +0000
(22:06 -0400)
libavcodec/mpegaudiodec.c
patch
|
blob
|
history
diff --git
a/libavcodec/mpegaudiodec.c
b/libavcodec/mpegaudiodec.c
index
3aef5fb
..
58e2bf7
100644
(file)
--- a/
libavcodec/mpegaudiodec.c
+++ b/
libavcodec/mpegaudiodec.c
@@
-1795,7
+1795,7
@@
static int decode_frame(AVCodecContext * avctx, void *data, int *data_size,
avctx->bit_rate = s->bit_rate;
avctx->sub_id = s->layer;
- if (*data_size <
1152
* avctx->channels * sizeof(OUT_INT))
+ if (*data_size <
avctx->frame_size
* avctx->channels * sizeof(OUT_INT))
return AVERROR(EINVAL);
*data_size = 0;
@@
-1871,6
+1871,9
@@
static int decode_frame_adu(AVCodecContext *avctx, void *data, int *data_size,
avctx->bit_rate = s->bit_rate;
avctx->sub_id = s->layer;
+ if (*data_size < avctx->frame_size * avctx->channels * sizeof(OUT_INT))
+ return AVERROR(EINVAL);
+
s->frame_size = len;
#if FF_API_PARSE_FRAME