mirror of https://git.ffmpeg.org/ffmpeg.git
ws_snd1: Fix wrong samples count and crash.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit9fb7a5af97
) Addresses CVE-2012-0848 Reviewed-by: Justin Ruggles <justin.ruggles@gmail.com> Signed-off-by: Reinhard Tartler <siretart@tauware.de> (cherry picked from commit697a45d861
) Signed-off-by: Reinhard Tartler <siretart@tauware.de>
This commit is contained in:
parent
847c7cd0c8
commit
e676bbb8cf
|
@ -95,8 +95,8 @@ static int ws_snd_decode_frame(AVCodecContext *avctx,
|
|||
|
||||
/* make sure we don't write more than out_size samples */
|
||||
switch (code) {
|
||||
case 0: smp = 4; break;
|
||||
case 1: smp = 2; break;
|
||||
case 0: smp = 4*(count+1); break;
|
||||
case 1: smp = 2*(count+1); break;
|
||||
case 2: smp = (count & 0x20) ? 1 : count + 1; break;
|
||||
default: smp = count + 1; break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue