[FFmpeg-devel] [PATCH] H264 parser fix

Howard Chu hyc
Tue May 25 21:01:43 CEST 2010


Howard Chu wrote:
> Carl Eugen Hoyos wrote:
>> Michael Niedermayer<michaelni<at>   gmx.at>   writes:
>>
>>> if this is the issue the parser should be improved to suport the slghtly
>>> differnt way to pack things and also to look in extradata.
>>
>> Which would (probably) fix FFmpeg issues 1831 and 1253.
>
> I tried the mkv in 1831, it still has the same problem. Haven't looked at why yet.

With this patch the video plays for a while, but SEGVs later on. Perhaps the 
mkv file is truncated.

Index: libavcodec/h264_ps.c
===================================================================
--- libavcodec/h264_ps.c	(revision 23295)
+++ libavcodec/h264_ps.c	(working copy)
@@ -205,6 +205,9 @@
          sps->num_reorder_frames= get_ue_golomb(&s->gb);
          get_ue_golomb(&s->gb); /*max_dec_frame_buffering*/

+        if(sps->num_reorder_frames < 0)
+            sps->num_reorder_frames = 0;
+
          if(sps->num_reorder_frames > 16U /*max_dec_frame_buffering || 
max_dec_frame_buffering > 16*/){
              av_log(h->s.avctx, AV_LOG_ERROR, "illegal num_reorder_frames 
%d\n", sps->num_reorder_frames);
              return -1;

-- 
   -- Howard Chu
   CTO, Symas Corp.           http://www.symas.com
   Director, Highland Sun     http://highlandsun.com/hyc/
   Chief Architect, OpenLDAP  http://www.openldap.org/project/



More information about the ffmpeg-devel mailing list