[FFmpeg-trac] #5319(undetermined:new): ac3 decoder can become "broken from then on" if fed certain corrupted input

FFmpeg trac at avcodec.org
Wed Mar 9 20:27:28 CET 2016


#5319: ac3 decoder can become "broken from then on" if fed certain corrupted input
-------------------------------------+-------------------------------------
             Reporter:  rogerdpack   |                     Type:  defect
               Status:  new          |                 Priority:  normal
            Component:               |                  Version:
  undetermined                       |  unspecified
             Keywords:               |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 Summary of the bug:  While decoding some ac3 data received from a "live"
 source (i.e. with some small packet loss), the decoder can enter a state
 where it just outputs "junk" from then on and forever (i.e. doesn't
 recover).


 How to reproduce:
 {{{
 % /ffmpeg -i 7mate.small.ts -y out.wav
 ffmpeg version N-78986-ga62d768 Copyright (c) 2000-2016 the FFmpeg
 developers
   built with Apple LLVM version 7.0.2 (clang-700.1.81)
   configuration: --enable-libx264 --enable-gpl
   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
 Input #0, mpegts, from '7mate.small.ts':
   Duration: 00:00:28.06, start: 1.400000, bitrate: 412 kb/s
   Program 1
     Metadata:
       service_name    : Service01
       service_provider: FFmpeg
     Stream #0:0[0x100](eng): Audio: ac3 ([129][0][0][0] / 0x0081), 48000
 Hz, stereo, fltp, 384 kb/s
 Output #0, wav, to 'out.wav':
   Metadata:
     ISFT            : Lavf57.28.100
     Stream #0:0(eng): Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz,
 stereo, s16, 1536 kb/s
     Metadata:
       encoder         : Lavc57.28.100 pcm_s16le
 Stream mapping:
   Stream #0:0 -> #0:0 (ac3 (native) -> pcm_s16le (native))
 Press [q] to stop, [?] for help
 [ac3 @ 0x7fdef1095400] exponent -1 is out-of-range
 [ac3 @ 0x7fdef1095400] error decoding the audio block
 [ac3 @ 0x7fdef1095400] frame sync error
 Error while decoding stream #0:0: Invalid data found when processing input
 [ac3 @ 0x7fdef1095400] delta bit allocation strategy reserved
 [ac3 @ 0x7fdef1095400] error decoding the audio block
 [ac3 @ 0x7fdef1095400] frame sync error
 Error while decoding stream #0:0: Invalid data found when processing input
 [ac3 @ 0x7fdef1095400] frame sync error
 Error while decoding stream #0:0: Invalid data found when processing input
 [ac3 @ 0x7fdef1095400] exponent 25 is out-of-range
 [ac3 @ 0x7fdef1095400] error decoding the audio block
 [ac3 @ 0x7fdef1095400] frame sync error
 Error while decoding stream #0:0: Invalid data found when processing input
 [ac3 @ 0x7fdef1095400] delta bit allocation strategy reserved
 [ac3 @ 0x7fdef1095400] error decoding the audio block
 [ac3 @ 0x7fdef1095400] frame sync error
 Error while decoding stream #0:0: Invalid data found when processing input
 [ac3 @ 0x7fdef1095400] new coupling strategy must be present in block 0
 [ac3 @ 0x7fdef1095400] error decoding the audio block
 Input stream #0:0 frame changed from rate:48000 fmt:fltp ch:2 chl:stereo
 to rate:44100 fmt:fltp ch:2 chl:stereo
 [ac3 @ 0x7fdef1095400] frame sync error
 Error while decoding stream #0:0: Invalid data found when processing input
 Input stream #0:0 frame changed from rate:44100 fmt:fltp ch:2 chl:stereo
 to rate:48000 fmt:fltp ch:2 chl:stereo
 [ac3 @ 0x7fdef1095400] frame sync error
 Error while decoding stream #0:0: Invalid data found when processing input
 [ac3 @ 0x7fdef1095400] exponent 26 is out-of-range
 [ac3 @ 0x7fdef1095400] error decoding the audio block
 [ac3 @ 0x7fdef1095400] frame sync error
 Error while decoding stream #0:0: Invalid data found when processing input
 [ac3 @ 0x7fdef1095400] invalid coupling range (9 >= 5)
 [ac3 @ 0x7fdef1095400] error decoding the audio block
 [ac3 @ 0x7fdef1095400] frame sync error
 Error while decoding stream #0:0: Invalid data found when processing input
 [ac3 @ 0x7fdef1095400] exponent -1 is out-of-range
 [ac3 @ 0x7fdef1095400] error decoding the audio block
 Input stream #0:0 frame changed from rate:48000 fmt:fltp ch:2 chl:stereo
 to rate:32000 fmt:fltp ch:4 chl:quad(side)
 [ac3 @ 0x7fdef1095400] frame sync error
 Error while decoding stream #0:0: Invalid data found when processing input
 [ac3 @ 0x7fdef1095400] new coupling strategy must be present in block 0
 [ac3 @ 0x7fdef1095400] error decoding the audio block
 Input stream #0:0 frame changed from rate:32000 fmt:fltp ch:4
 chl:quad(side) to rate:48000 fmt:fltp ch:2 chl:stereo
 [ac3 @ 0x7fdef1095400] new coupling strategy must be present in block 0
 [ac3 @ 0x7fdef1095400] error decoding the audio block

 ...

 [ac3 @ 0x7fdef1095400] new coupling strategy must be present in block 0
 [ac3 @ 0x7fdef1095400] error decoding the audio block
 [ac3 @ 0x7fdef1095400] frame sync error
 Error while decoding stream #0:0: Invalid data found when processing input
 [ac3 @ 0x7fdef1095400] new coupling strategy must be present in block 0
 [ac3 @ 0x7fdef1095400] error decoding the audio block
 [ac3 @ 0x7fdef1095400] new coupling strategy must be present in block 0
 [ac3 @ 0x7fdef1095400] error decoding the audio block
 [ac3 @ 0x7fdef1095400] new coupling strategy must be present in block 0
 [ac3 @ 0x7fdef1095400] error decoding the audio block
 [ac3 @ 0x7fdef1095400] frame sync error
 Error while decoding stream #0:0: Invalid data found when processing input
 [ac3 @ 0x7fdef1095400] new coupling strategy must be present in block 0
 [ac3 @ 0x7fdef1095400] error decoding the audio block
 [ac3 @ 0x7fdef1095400] new coupling strategy must be present in block 0

 ...

 [ac3 @ 0x7fdef1095400] error decoding the audio block
 [ac3 @ 0x7fdef1095400] new coupling strategy must be present in block 0
 [ac3 @ 0x7fdef1095400] error decoding the audio block
 [ac3 @ 0x7fdef1095400] incomplete frame
 size=    4823kB time=00:00:28.09 bitrate=1406.2kbits/s speed= 409x
 }}}

 full output (which has many repeated lines) here:
 https://gist.github.com/rdp/85f7273c59bb692f10d1

 You'll notice the audio "conks out" after about 10s.

 However, if you skip past 10s, it successfully decodes the audio after
 that point.


 {{{
 ./ffmpeg -ss 10 -i 7mate.small.ts 7mate.after.wav
 ffmpeg version N-78986-ga62d768 Copyright (c) 2000-2016 the FFmpeg
 developers
   built with Apple LLVM version 7.0.2 (clang-700.1.81)
   configuration: --enable-libx264 --enable-gpl
   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
 Input #0, mpegts, from '7mate.small.ts':
   Duration: 00:00:28.06, start: 1.400000, bitrate: 412 kb/s
   Program 1
     Metadata:
       service_name    : Service01
       service_provider: FFmpeg
     Stream #0:0[0x100](eng): Audio: ac3 ([129][0][0][0] / 0x0081), 48000
 Hz, stereo, fltp, 384 kb/s
 Output #0, wav, to '7mate.after.wav':
   Metadata:
     ISFT            : Lavf57.28.100
     Stream #0:0(eng): Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz,
 stereo, s16, 1536 kb/s
     Metadata:
       encoder         : Lavc57.28.100 pcm_s16le
 Stream mapping:
   Stream #0:0 -> #0:0 (ac3 (native) -> pcm_s16le (native))
 Press [q] to stop, [?] for help
 [ac3 @ 0x7fcc12888600] exponent -1 is out-of-range
 [ac3 @ 0x7fcc12888600] error decoding the audio block
 [ac3 @ 0x7fcc12888600] frame sync error
 Error while decoding stream #0:0: Invalid data found when processing input
 [ac3 @ 0x7fcc12888600] exponent -1 is out-of-range
 [ac3 @ 0x7fcc12888600] error decoding the audio block
 [ac3 @ 0x7fcc12888600] frame sync error
 Error while decoding stream #0:0: Invalid data found when processing input
 [ac3 @ 0x7fcc12888600] exponent -1 is out-of-range
 [ac3 @ 0x7fcc12888600] error decoding the audio block
 [ac3 @ 0x7fcc12888600] frame sync error
 Error while decoding stream #0:0: Invalid data found when processing input
 [ac3 @ 0x7fcc12888600] exponent 25 is out-of-range
 [ac3 @ 0x7fcc12888600] error decoding the audio block
 [ac3 @ 0x7fcc12888600] frame sync error
 Error while decoding stream #0:0: Invalid data found when processing input
 [ac3 @ 0x7fcc12888600] incomplete frame
 size=    3237kB time=00:00:18.09 bitrate=1465.4kbits/s speed= 609x
 video:0kB audio:3237kB subtitle:0kB other streams:0kB global headers:0kB
 muxing overhead: 0.002353%
 }}}

 It seems something at around 10s is somehow poison pilling the rest of the
 output and from then on it no longer recovers or decodes anything, even
 though there is some valid ac3 data there.

--
Ticket URL: <https://trac.ffmpeg.org/ticket/5319>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list