[FFmpeg-devel] [PATCH] fix parsing of broken mp3 streams

Michael Niedermayer michaelni
Sun Apr 19 23:49:21 CEST 2009


On Sun, Apr 19, 2009 at 11:18:06PM +0200, Zdenek Kabelac wrote:
> Hi
> 
> 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...
> 
> Zdenek
> 
> - Fix buffer overrun
> - Properly return parsed bytes together with skipped bytes

please provide a sample so we can confirm the bugfix, the patch
looks mostly correct though

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Dictatorship naturally arises out of democracy, and the most aggravated
form of tyranny and slavery out of the most extreme liberty. -- Plato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090419/b2172509/attachment.pgp>



More information about the ffmpeg-devel mailing list