Opened 8 years ago

Closed 8 years ago

#5311 closed defect (fixed)

AVI demuxer fails to parse indexed xxpc (palette change) chunks

Reported by: matsp888 Owned by:
Priority: normal Component: avformat
Version: git-master Keywords: pal8 avi
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description (last modified by Carl Eugen Hoyos)

The AVI demuxer (libavformat/avidec.c) fails to parse indexed xxpc (palette change) chunks, resulting in "stream_ptr out of bounds" error messages rather than switching the palette. The TOON.AVI file (from King's Quest VI) below contains indexed xxpc chunks, and it plays fine with Windows Media Player.

File:
https://drive.google.com/open?id=0B3_pEBoLs0faaFY0ME92SDA1VEU

How to reproduce:

% ffmpeg -i TOON.AVI -c:v rawvideo out.avi
ffmpeg version N-78970-ge1aa88d Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 4.7 (Debian 4.7.2-5)
  configuration: --prefix=/home/mats --enable-shared --enable-libx264 --enable-libxvid --enable-libtheora --enable-libvpx --enable-libmp3lame --enable-libvorbis --enable-libfaac --enable-libfdk-aac --enable-libopus --enable-gpl --enable-nonfree
  libavutil      55. 19.100 / 55. 19.100
  libavcodec     57. 28.100 / 57. 28.100
  libavformat    57. 28.100 / 57. 28.100
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 39.102 /  6. 39.102
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
[avi @ 0x23bf3a0] non-interleaved AVI
Guessed Channel Layout for  Input Stream #0.1 : mono
Input #0, avi, from 'toon.avi':
  Duration: 00:05:52.75, start: 0.000000, bitrate: 703 kb/s
    Stream #0:0: Video: msvideo1 (CRAM / 0x4D415243), pal8, 200x100, 449 kb/s, 8 fps, 8 tbr, 8 tbn, 8 tbc
    Stream #0:1: Audio: pcm_u8 ([1][0][0][0] / 0x0001), 22050 Hz, 1 channels, u8, 176 kb/s
Output #0, avi, to 'test.avi':
  Metadata:
    ISFT            : Lavf57.28.100
    Stream #0:0: Video: rawvideo, pal8, 200x100, q=2-31, 200 kb/s, 8 fps, 8 tbn, 8 tbc
    Metadata:
      encoder         : Lavc57.28.100 rawvideo
    Stream #0:1: Audio: mp3 (libmp3lame) (U[0][0][0] / 0x0055), 22050 Hz, mono, s16p
    Metadata:
      encoder         : Lavc57.28.100 libmp3lame
Stream mapping:
  Stream #0:0 -> #0:0 (msvideo1 (native) -> rawvideo (native))
  Stream #0:1 -> #0:1 (pcm_u8 (native) -> mp3 (libmp3lame))
Press [q] to stop, [?] for help
[msvideo1 @ 0x23e2e20]  MS Video-1 warning: stream_ptr out of bounds (46 >= 44)
[msvideo1 @ 0x23e2e20]  MS Video-1 warning: stream_ptr out of bounds (954 >= 952)
frame=  366 fps=0.0 q=-0.0 size=    7335kB time=00:00:45.75 bitrate=1313.4kbits/s speed=91.4x    
[msvideo1 @ 0x23e2e20]  MS Video-1 warning: stream_ptr out of bounds (954 >= 952)
[msvideo1 @ 0x23e2e20]  MS Video-1 warning: stream_ptr out of bounds (946 >= 944)
frame=  721 fps=720 q=-0.0 size=   14479kB time=00:01:30.12 bitrate=1316.1kbits/s speed=90.1x    
[msvideo1 @ 0x23e2e20]  MS Video-1 warning: stream_ptr out of bounds (946 >= 944)
    Last message repeated 1 times
frame= 1084 fps=722 q=-0.0 size=   21723kB time=00:02:15.50 bitrate=1313.3kbits/s speed=90.3x    
frame= 1446 fps=722 q=-0.0 size=   29008kB time=00:03:00.75 bitrate=1314.7kbits/s speed=90.3x    
[msvideo1 @ 0x23e2e20]  MS Video-1 warning: stream_ptr out of bounds (946 >= 944)
[msvideo1 @ 0x23e2e20]  MS Video-1 warning: stream_ptr out of bounds (922 >= 920)
frame= 1814 fps=725 q=-0.0 size=   36392kB time=00:03:46.75 bitrate=1314.8kbits/s speed=90.6x    
[msvideo1 @ 0x23e2e20]  MS Video-1 warning: stream_ptr out of bounds (918 >= 916)
[msvideo1 @ 0x23e2e20]  MS Video-1 warning: stream_ptr out of bounds (678 >= 676)
frame= 2133 fps=710 q=-0.0 size=   42813kB time=00:04:26.62 bitrate=1315.4kbits/s speed=88.8x    
[msvideo1 @ 0x23e2e20]  MS Video-1 warning: stream_ptr out of bounds (478 >= 476)
[msvideo1 @ 0x23e2e20]  MS Video-1 warning: stream_ptr out of bounds (10 >= 8)
    Last message repeated 5 times
[msvideo1 @ 0x23e2e20]  MS Video-1 warning: stream_ptr out of bounds (14 >= 8)
    Last message repeated 3 times
[msvideo1 @ 0x23e2e20]  MS Video-1 warning: stream_ptr out of bounds (18 >= 12)
    Last message repeated 1 times
[msvideo1 @ 0x23e2e20]  MS Video-1 warning: stream_ptr out of bounds (14 >= 8)
    Last message repeated 2 times
[msvideo1 @ 0x23e2e20]  MS Video-1 warning: stream_ptr out of bounds (10 >= 8)
    Last message repeated 5 times
[msvideo1 @ 0x23e2e20]  MS Video-1 warning: stream_ptr out of bounds (54 >= 52)
frame= 2504 fps=715 q=-0.0 size=   50218kB time=00:05:13.00 bitrate=1314.3kbits/s speed=89.3x    
[msvideo1 @ 0x23e2e20]  MS Video-1 warning: stream_ptr out of bounds (54 >= 52)
    Last message repeated 14 times
frame= 2870 fps=733 q=-0.0 Lsize=   57834kB time=00:05:58.75 bitrate=1320.6kbits/s speed=91.7x    
video:58925kB audio:1378kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

Change History (3)

comment:1 by matsp888, 8 years ago

Remove the "input" from the command line.

comment:2 by Carl Eugen Hoyos, 8 years ago

Description: modified (diff)
Keywords: pal8 avi added

comment:3 by Carl Eugen Hoyos, 8 years ago

Reproduced by developer: set
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.