Opened 17 months ago

Last modified 2 months ago

#10254 new defect

Unsupported EXR in the wild

Reported by: Eugene Owned by:
Priority: normal Component: avcodec
Version: 6.0 Keywords: exr avcodec decoding images
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description (last modified by Eugene)

Sample file: https://www.dropbox.com/s/y4wd815sz5syj6a/ffmpeg-unsupported.exr?dl=0

ffmpeg version 6.0 Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-44)
  configuration: --enable-libx264 --enable-libvorbis --enable-libtheora --enable-gpl --enable-indev=alsa --enable-nonfree --disable-shared --enable-nvenc --enable-cuda --enable-cuvid --extra-cflags=-Ilocal/include --extra-cflags=-I/usr/local/cuda/targets/x86_64-linux/include --extra-ldflags=-L/usr/local/cuda/targets/x86_64-linux/lib --extra-ldflags=-L/usr/lib64/nvidia --enable-encoder=mjpeg --enable-decoder=mjpeg --enable-asm --enable-libfreetype --enable-libfontconfig
  libavutil      58.  2.100 / 58.  2.100
  libavcodec     60.  3.100 / 60.  3.100
  libavformat    60.  3.100 / 60.  3.100
  libavdevice    60.  1.100 / 60.  1.100
  libavfilter     9.  3.100 /  9.  3.100
  libswscale      7.  1.100 /  7.  1.100
  libswresample   4. 10.100 /  4. 10.100
  libpostproc    57.  1.100 / 57.  1.100
Input #0, exr_pipe, from '/data/snfs1/.projects/Homes/root/ffmpeg 6 tets/EXR_Jaguar_Innovationlab100.exr':
  Duration: N/A, bitrate: N/A
  Stream #0:0: Video: exr, gbrpf32le, 1280x720 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 25 tbn
Stream mapping:
  Stream #0:0 -> #0:0 (exr (native) -> mjpeg (native))
Press [q] to stop, [?] for help
strange codes is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
If you want to help, upload a sample of this file to https://streams.videolan.org/upload/ and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)
[exr @ 0x34026c0] decode_block() failed.

Change History (3)

comment:1 by Eugene, 17 months ago

Description: modified (diff)

comment:2 by Tutul, 3 months ago

Same problem with OpenEXR file generated from Blender (latest version)

ffmpeg version n6.1.1 Copyright (c) 2000-2023 the FFmpeg developers

built with gcc 13.2.1 (GCC) 20230801
configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-frei0r --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libharfbuzz --enable-libiec61883 --enable-libjack --enable-libjxl --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libplacebo --enable-libpulse --enable-librav1e --enable-librsvg --enable-librubberband --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpl --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-nvdec --enable-nvenc --enable-opencl --enable-opengl --enable-shared --enable-vapoursynth --enable-version3 --enable-vulkan
libavutil 58. 29.100 / 58. 29.100
libavcodec 60. 31.102 / 60. 31.102
libavformat 60. 16.100 / 60. 16.100
libavdevice 60. 3.100 / 60. 3.100
libavfilter 9. 12.100 / 9. 12.100
libswscale 7. 5.100 / 7. 5.100
libswresample 4. 12.100 / 4. 12.100
libpostproc 57. 3.100 / 57. 3.100

Input #0, image2, from './test%4d.exr':

Duration: 00:00:01.10, start: 0.000000, bitrate: N/A
Stream #0:0: Video: exr, gbrapf32le(unknown/unknown/linear), 3840x2160 [SAR 1:1 DAR 16:9], 60 fps, 60 tbr, 60 tbn

File 'test.mp4' already exists. Overwrite? [y/N] y
Stream mapping:

Stream #0:0 -> #0:0 (exr (native) -> h264 (libx264))

Press [q] to stop, ? for help
strange codes is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
If you want to help, upload a sample of this file to https://streams.videolan.org/upload/ and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)
[exr @ 0x5598deae0e00] decode_block() failed.

Demo file uploaded on "https://streams.videolan.org/upload/" with a reference to this ticket number

comment:3 by vectronic, 2 months ago

I believe this is because the EXR files are creating large VLC tables - large enough that the index into sub-tables is created than 2^16 which is the limit defined here:

https://github.com/FFmpeg/FFmpeg/blob/1001bdc5047ec7ed0754a2084b77637028bb82cc/libavcodec/vlc.h#L25

When the table is being constructed, the offset into the sub-table is stored here and a narrowing conversion occurs, which then causes the strange codes message on the next line:

https://github.com/FFmpeg/FFmpeg/blob/1001bdc5047ec7ed0754a2084b77637028bb82cc/libavcodec/vlc.c#L211-L212

Note: See TracTickets for help on using tickets.