[FFmpeg-devel] [PATCH] libvorbis.c: use memmove() when source/dest overlap and add buffer checks

Stefano Sabatini stefano.sabatini-lala
Tue May 11 00:03:20 CEST 2010


On date Monday 2010-05-10 09:28:45 -0700, Thierry Foucu encoded:
> Hi,
> 
> $subject
> 
> Find these problems when using version 1.3.1 of the vorbis library
> 
> 
> Index: libavcodec/libvorbis.c
> ===================================================================
> --- libavcodec/libvorbis.c (revision 23079)
> +++ libavcodec/libvorbis.c (working copy)
> @@ -171,9 +171,13 @@
>               * not, apparently the end of stream decision is in libogg. */
>              if(op.bytes==1)
>                  continue;
> +            if (context->buffer_index + sizeof(ogg_packet) + op.bytes >
> BUFFER_SIZE) {
> +              av_log(avccontext, AV_LOG_ERROR, "libvorbis: buffer
> overflow.");
> +              return -1;
> +            }

Patch mangled, please send it as an attachment. Also it should return
something different from -1, maybe AVERROR_INVALIDDATA should be ok.

Regards.
-- 
FFmpeg = Fascinating & Fantastic Multipurpose Powerful Extravagant Gnome



More information about the ffmpeg-devel mailing list