[FFmpeg-trac] #1718(undetermined:new): MP3 parser get frame_size wrong

FFmpeg trac at avcodec.org
Wed Sep 5 05:30:04 CEST 2012


#1718: MP3 parser get frame_size wrong
-------------------------------------+-------------------------------------
             Reporter:  adam_csheng  |                     Type:  defect
               Status:  new          |                 Priority:  normal
            Component:               |                  Version:
  undetermined                       |  unspecified
             Keywords:  MP3 parser   |               Blocked By:
  frame_size                         |  Reproduced by developer:  0
             Blocking:               |
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 Summary of the bug:[[BR]]
 MP3 parser get the frame_size wrong when playback,
 the second and third frame_size are wrong.[[BR]]
 How to reproduce:
 {{{
 ffprobe -show_packets $FILENAME[[BR]]
 The first packet is right, packet size is 488
 [PACKET]
 codec_type=audio
 stream_index=0
 pts=0
 pts_time=0.000000
 dts=0
 dts_time=0.000000
 duration=384
 duration_time=0.008707
 convergence_duration=N/A
 convergence_duration_time=N/A
 size=488
 pos=167471
 flags=K
 [/PACKET]
 The second packet size is wrong: 333
 [PACKET]
 codec_type=audio
 stream_index=0
 pts=383
 pts_time=0.008685
 dts=383
 dts_time=0.008685
 duration=384
 duration_time=0.008707
 convergence_duration=N/A
 convergence_duration_time=N/A
 size=333
 pos=167959
 flags=K
 [/PACKET]
 And the third packets is wrong:643
 [PACKET]
 codec_type=audio
 stream_index=0
 pts=767
 pts_time=0.017392
 dts=767
 dts_time=0.017392
 duration=384
 duration_time=0.008707
 convergence_duration=N/A
 convergence_duration_time=N/A
 size=643
 pos=N/A
 flags=K
 [/PACKET]
 The fourth packets is right:488
 [PACKET]
 codec_type=audio
 stream_index=0
 pts=1151
 pts_time=0.026100
 dts=1151
 dts_time=0.026100
 duration=384
 duration_time=0.008707
 convergence_duration=N/A
 convergence_duration_time=N/A
 size=488
 pos=168935
 flags=K
 [/PACKET]

 Analysis:
 As the first packet get the pc->state is 0xFFFFE275.
 When parser the second packet, the first four bytes is 0xFFFFE205,
 then get the state is 0xFFE205FF when only use the first second packet
 byte 0xFF
 by state= (state<<8) + buf[i++];
 Then get the wrong MP3 header for this file but it's a valid MP3 frame
 header.
 }}}

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


More information about the FFmpeg-trac mailing list