Opened 5 years ago

Closed 5 years ago

#591 closed defect (fixed)

svq1: ffmpeg crashes with enabled lowres

Reported by: ami_stuff Owned by:
Priority: normal Component: avcodec
Version: unspecified Keywords: regression
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: yes

Description

seems to be related to:

diff --git a/libavcodec/utils.c b/libavcodec/utils.c

index 95fb65a..0ac81ba 100644 (file)


--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -601,10 +601,9 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, AVCodec *codec, AVD
     }
 
     if (avctx->codec->max_lowres < avctx->lowres || avctx->lowres < 0) {
-        av_log(avctx, AV_LOG_ERROR, "The maximum value for lowres supported by the decoder is %d\n",
+        av_log(avctx, AV_LOG_WARNING, "The maximum value for lowres supported by the decoder is %d\n",
                avctx->codec->max_lowres);
-        ret = AVERROR(EINVAL);
-        goto free_and_end;
+        avctx->lowres = avctx->codec->max_lowres;
     }
     if (avctx->codec->encode) {
         int i;
C:\>ffmpeg -lowres 1 -i C:\QT-Sorenson.mov -vcodec msmpeg4v2 out.avi
ffmpeg version N-34031-ge403a97, Copyright (c) 2000-2011 the FFmpeg developers
  built on Oct 25 2011 15:06:47 with gcc 4.6.1
  configuration: --enable-gpl --enable-version3 --enable-runtime-cpudetect --ena
ble-avisynth --enable-bzlib --enable-frei0r --enable-libopencore-amrnb --enable-
libopencore-amrwb --enable-libfreetype --enable-libgsm --enable-libmp3lame --ena
ble-libopenjpeg --enable-librtmp --enable-libschroedinger --enable-libspeex --en
able-libtheora --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis
--enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib

  libavutil    51. 22. 0 / 51. 22. 0
  libavcodec   53. 23. 0 / 53. 23. 0
  libavformat  53. 17. 0 / 53. 17. 0
  libavdevice  53.  4. 0 / 53.  4. 0
  libavfilter   2. 45. 0 /  2. 45. 0
  libswscale    2.  1. 0 /  2.  1. 0
  libpostproc  51.  2. 0 / 51.  2. 0
[adpcm_ima_qt @ 020990C0] The maximum value for lowres supported by the decoder
is 0
[svq1 @ 0209A0A0] The maximum value for lowres supported by the decoder is 0
[mov,mp4,m4a,3gp,3g2,mj2 @ 02092320] max_analyze_duration 5000000 reached at 500
3900

Seems stream 1 codec frame rate differs from container frame rate: 1000000.00 (1
000000/1) -> 24.00 (1000000/41667)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\QT-Sorenson.mov':
  Metadata:
    creation_time   : 2002-10-02 22:42:43
  Duration: 00:00:05.95, start: 0.000000, bitrate: 785 kb/s
    Stream #0:0(eng): Audio: adpcm_ima_qt (ima4 / 0x34616D69), 11025 Hz, 2 chann
els, s16, 88 kb/s
    Metadata:
      creation_time   : 2002-10-02 22:42:43
    Stream #0:1(eng): Video: svq1 (SVQ1 / 0x31515653), yuv410p, 96x64, 688 kb/s,
 24 fps, 24 tbr, 1000k tbn, 1000k tbc
    Metadata:
      creation_time   : 2002-10-02 22:42:43
Incompatible pixel format 'yuv410p' for codec 'msmpeg4v2', auto-selecting format
 'yuv420p'
[buffer @ 020A8F20] w:96 h:64 pixfmt:yuv410p tb:1/1000000 sar:0/1 sws_param:
[buffersink @ 020A9320] auto-inserting filter 'auto-inserted scale 0' between th
e filter 'src' and the filter 'out'
[scale @ 020A9720] w:96 h:64 fmt:yuv410p -> w:96 h:64 fmt:yuv420p flags:0x4
[adpcm_ima_qt @ 020990C0] The maximum value for lowres supported by the decoder
is 0
[svq1 @ 0209A0A0] The maximum value for lowres supported by the decoder is 0
Output #0, avi, to 'out.avi':
  Metadata:
    creation_time   : 2002-10-02 22:42:43
    ISFT            : Lavf53.17.0
    Stream #0:0(eng): Video: msmpeg4v2 (MP42 / 0x3234504D), yuv420p, 96x64, q=2-
31, 200 kb/s, 24 tbn, 24 tbc
    Metadata:
      creation_time   : 2002-10-02 22:42:43
    Stream #0:1(eng): Audio: mp3 (U[0][0][0] / 0x0055), 11025 Hz, 2 channels, s1
6, 128 kb/s
    Metadata:
      creation_time   : 2002-10-02 22:42:43
Stream mapping:
  Stream #0.1 -> #0.0 (svq1 -> msmpeg4v2)
  Stream #0.0 -> #0.1 (adpcm_ima_qt -> libmp3lame)
Press [q] to stop, [?] for help

C:\>

Attachments (1)

QT-Sorenson.mov (571.3 KB) - added by ami_stuff 5 years ago.

Download all attachments as: .zip

Change History (6)

Changed 5 years ago by ami_stuff

comment:1 Changed 5 years ago by cehoyos

  • Keywords regression added
  • Reproduced by developer set
  • Status changed from new to open

The crash with ffplay is a regression since 125ea3ee06c4d71082bee3fc03c65d7c8c10d68c.

comment:2 Changed 5 years ago by cehoyos

Since I cannot reproduce a crash with ffmpeg, please provide backtrace etc. as explained on http://ffmpeg.org/bugreports.html

comment:3 Changed 5 years ago by ami_stuff

$ gdb ffmpeg_g.exe
GNU gdb (GDB) 7.2
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "mingw32".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from f:\MinGW\bin/ffmpeg_g.exe...done.
(gdb) r -lowres 1 -i QT-Sorenson.mov -vcodec msmpeg4v2 out.avi
Starting program: f:\MinGW\bin/ffmpeg_g.exe -lowres 1 -i QT-Sorenson.mov -vcodec
 msmpeg4v2 out.avi
[New Thread 5836.0x12bc]
ffmpeg version 0.8.5.git-4416931, Copyright (c) 2000-2011 the FFmpeg developers
  built on Oct 26 2011 18:05:33 with gcc 4.5.2
  configuration: --enable-static --disable-shared --disable-ffplay --disable-ffs
erver --disable-yasm
  libavutil    51. 22. 0 / 51. 22. 0
  libavcodec   53. 23. 0 / 53. 23. 0
  libavformat  53. 17. 0 / 53. 17. 0
  libavdevice  53.  4. 0 / 53.  4. 0
  libavfilter   2. 45. 0 /  2. 45. 0
  libswscale    2.  1. 0 /  2.  1. 0
[adpcm_ima_qt @ 03ca9020] The maximum value for lowres supported by the decoder
is 0
[svq1 @ 03caf440] The maximum value for lowres supported by the decoder is 0
[mov,mp4,m4a,3gp,3g2,mj2 @ 03ca8b20] max_analyze_duration 5000000 reached at 500
3900

Seems stream 1 codec frame rate differs from container frame rate: 1000000.00 (1
000000/1) -> 24.00 (1000000/41667)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'QT-Sorenson.mov':
  Metadata:
    creation_time   : 2002-10-02 22:42:43
  Duration: 00:00:05.95, start: 0.000000, bitrate: 785 kb/s
    Stream #0:0(eng): Audio: adpcm_ima_qt (ima4 / 0x34616D69), 11025 Hz, 2 chann
els, s16, 88 kb/s
    Metadata:
      creation_time   : 2002-10-02 22:42:43
    Stream #0:1(eng): Video: svq1 (SVQ1 / 0x31515653), yuv410p, 96x64, 688 kb/s,
 24 fps, 24 tbr, 1000k tbn, 1000k tbc
    Metadata:
      creation_time   : 2002-10-02 22:42:43
Incompatible pixel format 'yuv410p' for codec 'msmpeg4v2', auto-selecting format
 'yuv420p'
[buffer @ 03cb8f20] w:96 h:64 pixfmt:yuv410p tb:1/1000000 sar:0/1 sws_param:
[buffersink @ 03cb9320] auto-inserting filter 'auto-inserted scale 0' between th
e filter 'src' and the filter 'out'
[scale @ 03cb9720] w:96 h:64 fmt:yuv410p -> w:96 h:64 fmt:yuv420p flags:0x4
Incompatible sample format 's16' for codec 'ac3', auto-selecting format 'flt'
[ac3 @ 03ca7460] channel_layout not specified
[ac3 @ 03ca7460] No channel layout specified. The encoder will guess the layout,
 but it might be incorrect.
[adpcm_ima_qt @ 03ca9020] The maximum value for lowres supported by the decoder
is 0
[svq1 @ 03caf440] The maximum value for lowres supported by the decoder is 0
Output #0, avi, to 'out.avi':
  Metadata:
    creation_time   : 2002-10-02 22:42:43
    ISFT            : Lavf53.17.0
    Stream #0:0(eng): Video: msmpeg4v2 (MP42 / 0x3234504D), yuv420p, 96x64, q=2-
31, 200 kb/s, 24 tbn, 24 tbc
    Metadata:
      creation_time   : 2002-10-02 22:42:43
    Stream #0:1(eng): Audio: ac3 ([0] [0][0] / 0x2000), 11025 Hz, stereo, flt, 1
28 kb/s
    Metadata:
      creation_time   : 2002-10-02 22:42:43
Stream mapping:
  Stream #0.1 -> #0.0 (svq1 -> msmpeg4v2)
  Stream #0.0 -> #0.1 (adpcm_ima_qt -> ac3)
Press [q] to stop, [?] for help

Program received signal SIGSEGV, Segmentation fault.
0x00756c16 in svq1_decode_block_intra (pixels=0x439cdf0 "", pitch=192,
    bitbuf=<value optimized out>) at libavcodec/svq1dec.c:234
234               memset (&dst[y*(pitch / 4)], 0, width);
(gdb) bt
#0  0x00756c16 in svq1_decode_block_intra (pixels=0x439cdf0 "", pitch=192,
    bitbuf=<value optimized out>) at libavcodec/svq1dec.c:234
#1  0x00757019 in svq1_decode_frame (avctx=0x3caf440, data=0x3cbc2e0,
    data_size=0x22dedc, avpkt=0x22de38) at libavcodec/svq1dec.c:704
#2  0x004f6741 in avcodec_decode_video2 (avctx=0x3caf440, picture=0x3cbc2e0,
    got_picture_ptr=0x22dedc, avpkt=0x22de38) at libavcodec/utils.c:817
#3  0x0040743e in output_packet (ist=0x3cb82f8, ist_index=1,
    ost_table=0x4218508, nb_ostreams=2, pkt=0x22fbe8) at ffmpeg.c:1691
#4  0x0040a61a in transcode (output_files=<value optimized out>,
    nb_output_files=0, input_files=0x0, nb_input_files=4255059)
    at ffmpeg.c:2635
#5  0x0022ff48 in ?? ()
#6  0x00000000 in ?? ()
(gdb) disass $pc-32,$pc+32
Dump of assembler code from 0x756bf6 to 0x756c36:
   0x00756bf6 <svq1_decode_block_intra+1082>:   decl   -0x7adbdbbc(%ebx)
   0x00756bfc <svq1_decode_block_intra+1088>:   rorb   $0x84,(%edi)
   0x00756bff <svq1_decode_block_intra+1091>:   jo     0x756bfe <svq1_decode_blo
ck_intra+1090>
   0x00756c01 <svq1_decode_block_intra+1093>:   (bad)
   0x00756c02 <svq1_decode_block_intra+1094>:   decl   0x31042454(%ebx)
   0x00756c08 <svq1_decode_block_intra+1100>:   fisttpl -0x72cbdb94(%ebx)
   0x00756c0e <svq1_decode_block_intra+1106>:   jbe    0x756c10 <svq1_decode_blo
ck_intra+1108>
   0x00756c10 <svq1_decode_block_intra+1108>:   mov    %edx,%edi
   0x00756c12 <svq1_decode_block_intra+1110>:   mov    %esi,%ecx
   0x00756c14 <svq1_decode_block_intra+1112>:   xor    %eax,%eax
=> 0x00756c16 <svq1_decode_block_intra+1114>:   rep stos %al,%es:(%edi)
   0x00756c18 <svq1_decode_block_intra+1116>:   inc    %ebx
   0x00756c19 <svq1_decode_block_intra+1117>:   add    %ebp,%edx
   0x00756c1b <svq1_decode_block_intra+1119>:   cmp    0x24(%esp),%ebx
   0x00756c1f <svq1_decode_block_intra+1123>:   jb     0x756c10 <svq1_decode_blo
ck_intra+1108>
   0x00756c21 <svq1_decode_block_intra+1125>:   incl   0x30(%esp)
   0x00756c25 <svq1_decode_block_intra+1129>:   mov    0x30(%esp),%eax
   0x00756c29 <svq1_decode_block_intra+1133>:   cmp    %eax,0x3c(%esp)
   0x00756c2d <svq1_decode_block_intra+1137>:   jg     0x756808 <svq1_decode_blo
ck_intra+76>
   0x00756c33 <svq1_decode_block_intra+1143>:   jmp    0x756985 <svq1_decode_blo
ck_intra+457>
End of assembler dump.
(gdb) info all-registers
eax            0x0      0
ecx            0x8      8
edx            0x439d030        70897712
ebx            0x3      3
esp            0x22d818 0x22d818
ebp            0xc0     0xc0
esi            0x8      8
edi            0x439d030        70897712
eip            0x756c16 0x756c16 <svq1_decode_block_intra+1114>
eflags         0x210246 [ PF ZF IF RF ID ]
cs             0x1b     27
ss             0x23     35
ds             0x23     35
es             0x23     35
fs             0x3b     59
gs             0x0      0
st0            -inf     (raw 0xffff0000000000000000)
st1            -nan(0x000000010)        (raw 0xffff0000000000000010)
st2            -0.012505903840065002    (raw 0xbff8cce5900000000000)
st3            -8.3927585027721713e-006 (raw 0xbfee8cce9f901b200000)
st4            4.928071761160962e-011   (raw 0x3fdcd8bd27c633510000)
st5            -0.041961669921875       (raw 0xbffaabe0000000000000)
st6            0        (raw 0x00000000000000000000)
st7            0        (raw 0x00000000000000000000)
fctrl          0xffff037f       -64641
fstat          0xffff0120       -65248
ftag           0xffffffff       -1
fiseg          0x0      0
fioff          0x0      0
foseg          0xffff0000       -65536
fooff          0x0      0
fop            0x0      0
xmm0           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0},
  v16_int8 = {0xd5, 0xb8, 0x9d, 0xb8, 0x8b, 0x9b, 0x47, 0xba, 0xf4, 0xec,
    0x24, 0x3a, 0xd8, 0xfe, 0xe4, 0x3a}, v8_int16 = {0xb8d5, 0xb89d, 0x9b8b,
    0xba47, 0xecf4, 0x3a24, 0xfed8, 0x3ae4}, v4_int32 = {0xb89db8d5,
    0xba479b8b, 0x3a24ecf4, 0x3ae4fed8}, v2_int64 = {0xba479b8bb89db8d5,
    0x3ae4fed83a24ecf4}, uint128 = 0x3ae4fed83a24ecf4ba479b8bb89db8d5}
xmm1           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0},
  v16_int8 = {0x66, 0x4b, 0x38, 0xba, 0xea, 0x44, 0xed, 0x3b, 0xff, 0x74,
    0x57, 0xbb, 0xc4, 0x94, 0x9e, 0xba}, v8_int16 = {0x4b66, 0xba38, 0x44ea,
    0x3bed, 0x74ff, 0xbb57, 0x94c4, 0xba9e}, v4_int32 = {0xba384b66,
    0x3bed44ea, 0xbb5774ff, 0xba9e94c4}, v2_int64 = {0x3bed44eaba384b66,
    0xba9e94c4bb5774ff}, uint128 = 0xba9e94c4bb5774ff3bed44eaba384b66}
xmm2           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0},
  v16_int8 = {0xdf, 0x49, 0x99, 0x3b, 0x1e, 0xa, 0xc6, 0x3a, 0x21, 0xa8,
    0xb2, 0xba, 0x36, 0x43, 0xcb, 0x38}, v8_int16 = {0x49df, 0x3b99, 0xa1e,
    0x3ac6, 0xa821, 0xbab2, 0x4336, 0x38cb}, v4_int32 = {0x3b9949df,
    0x3ac60a1e, 0xbab2a821, 0x38cb4336}, v2_int64 = {0x3ac60a1e3b9949df,
    0x38cb4336bab2a821}, uint128 = 0x38cb4336bab2a8213ac60a1e3b9949df}
xmm3           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0},
  v16_int8 = {0xd4, 0x8b, 0x3a, 0xbb, 0x33, 0x87, 0x90, 0x3a, 0x20, 0xe6,
    0xd, 0xbb, 0x80, 0xa0, 0xd6, 0x3b}, v8_int16 = {0x8bd4, 0xbb3a, 0x8733,
    0x3a90, 0xe620, 0xbb0d, 0xa080, 0x3bd6}, v4_int32 = {0xbb3a8bd4,
    0x3a908733, 0xbb0de620, 0x3bd6a080}, v2_int64 = {0x3a908733bb3a8bd4,
    0x3bd6a080bb0de620}, uint128 = 0x3bd6a080bb0de6203a908733bb3a8bd4}
xmm4           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0},
  v16_int8 = {0xff, 0xff, 0x7f, 0xbf, 0xff, 0xff, 0x7f, 0xbf, 0xff, 0xff,
    0x7f, 0xbf, 0xff, 0xff, 0x7f, 0xbf}, v8_int16 = {0xffff, 0xbf7f, 0xffff,
    0xbf7f, 0xffff, 0xbf7f, 0xffff, 0xbf7f}, v4_int32 = {0xbf7fffff,
    0xbf7fffff, 0xbf7fffff, 0xbf7fffff}, v2_int64 = {0xbf7fffffbf7fffff,
    0xbf7fffffbf7fffff}, uint128 = 0xbf7fffffbf7fffffbf7fffffbf7fffff}
xmm5           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0},
  v16_int8 = {0xff, 0xff, 0x7f, 0x3f, 0xff, 0xff, 0x7f, 0x3f, 0xff, 0xff,
    0x7f, 0x3f, 0xff, 0xff, 0x7f, 0x3f}, v8_int16 = {0xffff, 0x3f7f, 0xffff,
    0x3f7f, 0xffff, 0x3f7f, 0xffff, 0x3f7f}, v4_int32 = {0x3f7fffff,
    0x3f7fffff, 0x3f7fffff, 0x3f7fffff}, v2_int64 = {0x3f7fffff3f7fffff,
    0x3f7fffff3f7fffff}, uint128 = 0x3f7fffff3f7fffff3f7fffff3f7fffff}
xmm6           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0},
  v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0,
    0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0},
  uint128 = 0x00000000000000000000000000000000}
xmm7           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0},
  v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0,
    0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0},
  uint128 = 0x00000000000000000000000000000000}
mxcsr          0x1fa0   [ PE IM DM ZM OM UM PM ]
mm0            {uint64 = 0x0, v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, 0x0,
    0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}
mm1            {uint64 = 0x10, v2_int32 = {0x10, 0x0}, v4_int16 = {0x10, 0x0,
    0x0, 0x0}, v8_int8 = {0x10, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}
mm2            {uint64 = 0xcce5900000000000, v2_int32 = {0x0, 0xcce59000},
  v4_int16 = {0x0, 0x0, 0x9000, 0xcce5}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0,
    0x90, 0xe5, 0xcc}}
mm3            {uint64 = 0x8cce9f901b200000, v2_int32 = {0x1b200000,
    0x8cce9f90}, v4_int16 = {0x0, 0x1b20, 0x9f90, 0x8cce}, v8_int8 = {0x0,
    0x0, 0x20, 0x1b, 0x90, 0x9f, 0xce, 0x8c}}
mm4            {uint64 = 0xd8bd27c633510000, v2_int32 = {0x33510000,
    0xd8bd27c6}, v4_int16 = {0x0, 0x3351, 0x27c6, 0xd8bd}, v8_int8 = {0x0,
    0x0, 0x51, 0x33, 0xc6, 0x27, 0xbd, 0xd8}}
mm5            {uint64 = 0xabe0000000000000, v2_int32 = {0x0, 0xabe00000},
  v4_int16 = {0x0, 0x0, 0x0, 0xabe0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0,
    0x0, 0xe0, 0xab}}
mm6            {uint64 = 0x0, v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, 0x0,
    0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}
mm7            {uint64 = 0x0, v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, 0x0,
    0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}
(gdb)

comment:4 Changed 5 years ago by cehoyos

  • Analyzed by developer set
  • Component changed from undetermined to avcodec

Also reproducible with ffmpeg, I don't know what I tested.

comment:5 Changed 5 years ago by michael

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

Will be fixed by implementing 125ea3ee06c4d71082bee3fc03c65d7c8c10d68c in ffplay. I think its not too usefull in ffmpeg but it could be done there too.

Note: See TracTickets for help on using tickets.