[FFmpeg-devel] [PATCH] vc1dec: use get_bits_long and limit the read bits to 32

Michael Niedermayer michaelni at gmx.at
Fri Jun 26 01:11:12 CEST 2015


On Thu, Jun 25, 2015 at 10:54:17PM +0200, Andreas Cadhalpun wrote:
> get_bits should not be used with more than 25 bits.
> 
> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
> ---
>  libavcodec/vc1dec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
> index 3fa39a5..d7a0cef 100644
> --- a/libavcodec/vc1dec.c
> +++ b/libavcodec/vc1dec.c
> @@ -469,7 +469,7 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx)
>          count = avctx->extradata_size*8 - get_bits_count(&gb);
>          if (count > 0) {

>              av_log(avctx, AV_LOG_INFO, "Extra data: %i bits left, value: %X\n",

maybe this should use "value32:" or something

> -                   count, get_bits(&gb, count));
> +                   count, get_bits_long(&gb, FFMIN(count, 32)));

LGTM

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

While the State exists there can be no freedom; when there is freedom there
will be no State. -- Vladimir Lenin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150626/b504b61f/attachment.asc>


More information about the ffmpeg-devel mailing list