[FFmpeg-devel] [PATCH] fix parsing of broken mp3 streams
Sat May 2 03:46:22 CEST 2009
On Sun, Apr 19, 2009 at 11:18:06PM +0200, Zdenek Kabelac wrote:
> Here is a small patch that fixes of running out-of-buffer in parsing
> broken mp3 data stream.
> This solution is rather a hotfix - better solution would be to check
> at least one or two next mp3
> frames in sequence whether they are part of the same audio stream or
> some random junk
> which has 0xfffx header inside. With this patch ugly noise could be
> sometimes noticed.
> Also questionable is whether it should return -1 if no header is found
> or rather return skipped
> bytes and out_size = 0 - as then usually such packet is rescaned
> multiple times with
> one-byte step forward...
> - Fix buffer overrun
> - Properly return parsed bytes together with skipped bytes
> Index: libavcodec/mpegaudiodec.c
> --- libavcodec/mpegaudiodec.c (revision 18627)
> +++ libavcodec/mpegaudiodec.c (working copy)
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Why not whip the teacher when the pupil misbehaves? -- Diogenes of Sinope
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: Digital signature
More information about the ffmpeg-devel