[FFmpeg-devel] [PATCH] ituh263dec: Prevent overreading header buffer

Michael Niedermayer michaelni at gmx.at
Mon Oct 21 17:58:45 CEST 2013


On Mon, Oct 21, 2013 at 04:44:20PM +0100, Derek Buitenhuis wrote:
> Signed-off-by: Derek Buitenhuis <derek.buitenhuis at gmail.com>
> ---
> Fixes a crash in a sample I have.
> ---
>  libavcodec/ituh263dec.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
> 
> diff --git a/libavcodec/ituh263dec.c b/libavcodec/ituh263dec.c
> index 08aeb30..6c7c12d 100644
> --- a/libavcodec/ituh263dec.c
> +++ b/libavcodec/ituh263dec.c
> @@ -874,6 +874,11 @@ int ff_h263_decode_picture_header(MpegEncContext *s)
>  
>      align_get_bits(&s->gb);
>  
> +    if (get_bits_left(&s->gb) < 22 - 8) {
> +        av_log(s->avctx, AV_LOG_ERROR, "Not enough bits to decode header.\n");
> +        return -1;
> +    }
> +

do you have "FF_INPUT_BUFFER_PADDING_SIZE" bytes padding after the
frame ?

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

I have often repented speaking, but never of holding my tongue.
-- Xenocrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20131021/177b13c4/attachment.asc>


More information about the ffmpeg-devel mailing list