[FFmpeg-devel] [PATCH] Ignore file size field in BMP header

Daniel Verkamp daniel
Mon Feb 16 07:34:47 CET 2009

On Mon, Nov 24, 2008 at 1:09 AM, Kostya <kostya.shishkov at gmail.com> wrote:
> On Sun, Nov 23, 2008 at 10:50:52PM -0600, Daniel Verkamp wrote:
>> This patch removes the reading and checking of the file size field in
>> the BMP decoder (known as bfSize in the MS docs).
>> This field isn't necessary to decode the bitmap correctly, so the
>> patch removes the read and checks (the second check is changed to use
>> the buffer size instead of the file size from the header).
> It is but dropping checks completely is not a good idea either.
> I will try to devise something more robust instead.


Sorry to revive this old thread, but I've been testing ffmpeg on media
from various old shareware games, and I found another broken BMP with
a nonsensical value in the file size field:


[bmp @ 0x2a81050]not enough data (308278 < 1445367)

I have no idea what software wrote this file, but it doesn't seem to
follow any nice pattern like the other common broken files.

Removing the checks completely allows it to decode correctly.

-- Daniel Verkamp

More information about the ffmpeg-devel mailing list