Ticket #699 (closed defect: fixed)

Opened 19 months ago

Last modified 19 months ago

BMP: support BMP OS/2 v2 with RLE compression

Reported by: ami_stuff Owned by:
Priority: normal Component: avcodec
Version: git-master Keywords: bmp
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

The attached file decodes correctly in IrfanView/Photoshop?.

Seems like header check should be modified to support this file:

libavcodec/bmp.c:

    depth = bytestream_get_le16(&buf);

//    if(ihsize == 40)
        comp = bytestream_get_le32(&buf);
//    else
//        comp = BMP_RGB;

    if(comp != BMP_RGB && comp != BMP_BITFIELDS && comp != BMP_RLE4 && comp != BMP_RLE8){

Attachments

bmp.bmp Download (778.4 KB) - added by ami_stuff 19 months ago.

Change History

comment:1 Changed 19 months ago by ami_stuff

C:\>ffmpeg -i bmp.bmp
ffmpeg version N-35295-gb55dd10, Copyright (c) 2000-2011 the FFmpeg developers
  built on Nov 30 2011 00:52:52 with gcc 4.6.2
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-ru
ntime-cpudetect --enable-avisynth --enable-bzlib --enable-frei0r --enable-libope
ncore-amrnb --enable-libopencore-amrwb --enable-libfreetype --enable-libgsm --en
able-libmp3lame --enable-libopenjpeg --enable-librtmp --enable-libschroedinger -
-enable-libspeex --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwben
c --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-
libxvid --enable-zlib
  libavutil    51. 29. 1 / 51. 29. 1
  libavcodec   53. 39. 1 / 53. 39. 1
  libavformat  53. 22. 0 / 53. 22. 0
  libavdevice  53.  4. 0 / 53.  4. 0
  libavfilter   2. 50. 0 /  2. 50. 0
  libswscale    2.  1. 0 /  2.  1. 0
  libpostproc  51.  2. 0 / 51.  2. 0
Input #0, image2, from 'bmp.bmp':
  Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: bmp, pal8, 1023x767, 25 tbr, 25 tbn, 25 tbc
At least one output file must be specified

Changed 19 months ago by ami_stuff

comment:2 Changed 19 months ago by ami_stuff

"the major difference between v1.x and v2.x files is the size of the bitmap header. This header is 14 bytes in length in v1.x BMP files and is 64 bytes in length in v2.x files."

and this seems to work

   if(ihsize == 40 || ihsize == 64)

comment:3 Changed 19 months ago by cehoyos

  • Keywords bmp added
  • Status changed from new to open
  • Version changed from unspecified to git-master
  • Component changed from undetermined to avcodec
  • Reproduced by developer set

Please consider sending a patch to ffmpeg-devel.

comment:4 Changed 19 months ago by cehoyos

  • Status changed from open to closed
  • Resolution set to fixed

Fixed by ami_stuff and Peter Ross.

Note: See TracTickets for help on using tickets.