[FFmpeg-devel] [PATCH] rmdec.c: correctly skip indexes

Ronald S. Bultje rsbultje
Tue Mar 10 13:55:48 CET 2009


Hi,

On Tue, Mar 10, 2009 at 2:14 AM, Kostya <kostya.shishkov at gmail.com> wrote:
> On Mon, Mar 09, 2009 at 11:57:58PM -0400, Ronald S. Bultje wrote:
>> @@ -440,7 +440,19 @@
>> ? ? ? ? ? ? ?state= (state<<8) + get_byte(pb);
>>
>> ? ? ? ? ? ? ?if(state == MKBETAG('I', 'N', 'D', 'X')){
>> - ? ? ? ? ? ? ? ?len = get_be16(pb) - 6;
>> + ? ? ? ? ? ? ? ?int n_pkts, expected_len;
>> + ? ? ? ? ? ? ? ?len = get_be32(pb);
>> + ? ? ? ? ? ? ? ?url_fskip(pb, 2);
>> + ? ? ? ? ? ? ? ?n_pkts = get_be32(pb);
>> + ? ? ? ? ? ? ? ?expected_len = 20 + n_pkts * 14;
>> + ? ? ? ? ? ? ? ?if (len == 20)
>> + ? ? ? ? ? ? ? ? ? ?/* some files don't add index entries to chunk size... */
>> + ? ? ? ? ? ? ? ? ? ?len = expected_len;
>> + ? ? ? ? ? ? ? ?else if (len != expected_len)
>> + ? ? ? ? ? ? ? ? ? ?av_log(s, AV_LOG_WARNING,
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? "Index size %d (%d pkts) is wrong, should be %d.\n",
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? len, n_pkts, expected_len);
>> + ? ? ? ? ? ? ? ?len -= 14; // we already read part of the index header
>> ? ? ? ? ? ? ? ? ?if(len<0)
>> ? ? ? ? ? ? ? ? ? ? ?continue;
>> ? ? ? ? ? ? ? ? ?goto skip;
>
> ok (additionally one can understand what it does without RM documentation :)

Applied.

Ronald




More information about the ffmpeg-devel mailing list