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:
b45eb9d
)
mlpdec: validate that the reported channel count matches the actual output
author
Justin Ruggles
<justin.ruggles@gmail.com>
Thu, 13 Oct 2011 02:30:44 +0000
(22:30 -0400)
committer
Justin Ruggles
<justin.ruggles@gmail.com>
Thu, 13 Oct 2011 19:13:02 +0000
(15:13 -0400)
channel count
libavcodec/mlpdec.c
patch
|
blob
|
history
diff --git
a/libavcodec/mlpdec.c
b/libavcodec/mlpdec.c
index
c90285a
..
15b8de4
100644
(file)
--- a/
libavcodec/mlpdec.c
+++ b/
libavcodec/mlpdec.c
@@
-909,7
+909,12
@@
static int output_data_internal(MLPDecodeContext *m, unsigned int substr,
int32_t *data_32 = (int32_t*) data;
int16_t *data_16 = (int16_t*) data;
- if (*data_size < (s->max_channel + 1) * s->blockpos * (is32 ? 4 : 2))
+ if (m->avctx->channels != s->max_matrix_channel + 1) {
+ av_log(m->avctx, AV_LOG_ERROR, "channel count mismatch\n");
+ return AVERROR_INVALIDDATA;
+ }
+
+ if (*data_size < m->avctx->channels * s->blockpos * (is32 ? 4 : 2))
return -1;
for (i = 0; i < s->blockpos; i++) {