Commit 7f4e4321 authored by Michael Chinen's avatar Michael Chinen Committed by Justin Ruggles

Check validity of the frame sync code in ff_flac_decode_frame_header().

Patch by Michael Chinen [mchinen at gmail]

Originally committed as revision 25910 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 625daac4
...@@ -38,7 +38,13 @@ int ff_flac_decode_frame_header(AVCodecContext *avctx, GetBitContext *gb, ...@@ -38,7 +38,13 @@ int ff_flac_decode_frame_header(AVCodecContext *avctx, GetBitContext *gb,
int bs_code, sr_code, bps_code; int bs_code, sr_code, bps_code;
/* frame sync code */ /* frame sync code */
skip_bits(gb, 16); if ((get_bits(gb, 15) & 0x7FFF) != 0x7FFC) {
av_log(avctx, AV_LOG_ERROR, "invalid sync code\n");
return -1;
}
/* variable block size stream code */
skip_bits1(gb);
/* block size and sample rate codes */ /* block size and sample rate codes */
bs_code = get_bits(gb, 4); bs_code = get_bits(gb, 4);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment