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:
88411b8
)
libopusenc: prevent an out-of-bounds read by returning early
author
Vittorio Giovara
<vittorio.giovara@gmail.com>
Tue, 11 Nov 2014 12:26:55 +0000
(13:26 +0100)
committer
Luca Barbato
<lu_zero@gentoo.org>
Mon, 12 Jan 2015 23:16:42 +0000
(
00:16
+0100)
CC: libav-stable@libav.org
Bug-Id: CID 1244188
(cherry picked from commit
8dd0a2c5cf40a8a49faae985adc11750b6429132
)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
libavcodec/libopusenc.c
patch
|
blob
|
history
diff --git
a/libavcodec/libopusenc.c
b/libavcodec/libopusenc.c
index
9af8bcd
..
8f75466
100644
(file)
--- a/
libavcodec/libopusenc.c
+++ b/
libavcodec/libopusenc.c
@@
-163,10
+163,11
@@
static int av_cold libopus_encode_init(AVCodecContext *avctx)
/* FIXME: Opus can handle up to 255 channels. However, the mapping for
* anything greater than 8 is undefined. */
- if (avctx->channels > 8)
- av_log(avctx, AV_LOG_
WARNING
,
+ if (avctx->channels > 8)
{
+ av_log(avctx, AV_LOG_
ERROR
,
"Channel layout undefined for %d channels.\n", avctx->channels);
-
+ return AVERROR_PATCHWELCOME;
+ }
if (!avctx->bit_rate) {
/* Sane default copied from opusenc */
avctx->bit_rate = 64000 * opus->stream_count +