New submission from Sergey <[email protected]>:

Hi Everybody 

I have the issue with H.264 decoder with Automated 
shared w32 builds since at least august 2010.
(for example with latest buils r25830 from 2010-11-
26).

The problem is: decoder crashes in case of SPS 
resolution changes on the fly.
I have 0-16 frames with small resolution followed by 
17th frame with larger resolution in SPS.
Decoder crashes on that one.
H.264 reference decoder works fine with such stream.

In attached file you can find 18th frames.
Also all_filese_together.zip contains same stream.

Thank you in addvance for any kind of information!

Here is a minimum code to repeate the issue



#ifndef INT64_C
#define INT64_C(c) (c ## LL)
#define UINT64_C(c) (c ## ULL)
#endif

#include <iostream>
#include <sstream>
#include <string>


extern "C" 
{
#include "libavcodec/avcodec.h"

}

int main(int argc, char *argv[])
{
        
        AVCodec *codec;
        AVCodecContext *c;
        AVFrame *picture;


        avcodec_init();

        avcodec_register_all();
        codec = avcodec_find_decoder(CODEC_ID_H264);

        c = avcodec_alloc_context();
        picture= avcodec_alloc_frame();

        if(codec->capabilities&CODEC_CAP_TRUNCATED)
                
                c->flags|= CODEC_FLAG_TRUNCATED;

        avcodec_open(c, codec);


        int max_data_size = 1000*1024;
        unsigned char* data = new unsigned char
[max_data_size+FF_INPUT_BUFFER_PADDING_SIZE ];
        
        int frame_number = 0;

        while(1)
        {
                std::ostringstream os;
                os << "frame" << frame_number 
<< ".264";
                
                FILE* f = fopen(os.str().c_str
(), "rb");
                if (!f)
                        break;

                int len = fread(data, 1, 
max_data_size, f);
                fclose(f);

                //memset(data+len, 0, 
FF_INPUT_BUFFER_PADDING_SIZE );  this is not 
nessesaraly to do; in file itself zerrows are present
                //len+=FF_INPUT_BUFFER_PADDING_SIZE ;
                
                int got_picture = 0;
                avcodec_decode_video(c, picture, 
&got_picture,data, len);

                if (got_picture)
                        std::cout << "got picture\n";

                frame_number++;
                
        }


        return 0;
}


//================================

C:\programming\universal_client\contrib\ffmpeg25830
\bin>ffplay.exe all_filese_to
gether.264
FFplay version SVN-r25830, Copyright (c) 2003-2010 
the FFmpeg developers
  built on Nov 26 2010 04:09:28 with gcc 4.4.2
  configuration: --enable-gpl --enable-version3 --
enable-libgsm --enable-pthread
s --enable-libvorbis --enable-libtheora --enable-
libspeex --enable-libmp3lame --
enable-libopenjpeg --enable-libschroedinger --enable-
libopencore_amrwb --enable-
libopencore_amrnb --enable-libvpx --disable-
decoder=libvpx --arch=x86 --enable-r
untime-cpudetect --enable-libxvid --enable-libx264 --
extra-libs='-lx264 -lpthrea
d' --enable-librtmp --extra-libs='-lrtmp -lpolarssl -
lws2_32 -lwinmm' --target-o
s=mingw32 --enable-avisynth --cross-prefix=i686-
mingw32- --cc='ccache i686-mingw
32-gcc' --enable-memalign-hack --enable-shared --
disable-static
  libavutil     50.33. 0 / 50.33. 0
  libavcore      0.14. 0 /  0.14. 0
  libavcodec    52.97. 2 / 52.97. 2
  libavformat   52.86. 1 / 52.86. 1
  libavdevice   52. 2. 2 / 52. 2. 2
  libavfilter    1.65. 0 /  1.65. 0
  libswscale     0.12. 0 /  0.12. 0
[h264 @ 02551a30] missing picture in access unit
[h264 @ 0037ab10] Estimating duration from bitrate, 
this may be inaccurate
Input #0, h264, from 'all_filese_together.264':
  Duration: N/A, bitrate: N/A
    Stream #0.0: Video: h264, yuv420p, 960x544, 25 
fps, 25 tbr, 1200k tbn, 50 tb
c
   0.28 A-V:  0.000 s:0.0 aq=    0KB [h264 @ 
02551a30] deblocking_filter_idc 32
out of range
vq=[h264 @ 02551a30] decode_slice_header error
   74KB sq=    [h264 @ 02551a30] concealing 8160 DC, 
8160 AC, 8160 MV errors
[h264 @ 02551a30] no frame!
   4.00 A-V:  0.000 s:0.0 aq=    0KB vq=    0KB 
sq=    0B f=0/0
File 'ffmpeg_test.zip' not attached - you can download it from 
https://roundup.ffmpeg.org/file1193.

----------
files: ffmpeg_test.zip
messages: 12714
priority: normal
status: new
substatus: new
title: avcodec_decode_video craches with H.264 steram
type: bug

________________________________________________
FFmpeg issue tracker <[email protected]>
<https://roundup.ffmpeg.org/issue2393>
________________________________________________

Reply via email to