[FFmpeg-devel] [PATCH] fix ffmpeg crash on reading "non-interleved" DV type 1 AVI files

Maksym Veremeyenko verem
Fri Jan 15 10:45:31 CET 2010


Michael Niedermayer ???????(??):
> On Thu, Jan 14, 2010 at 06:38:37PM +0200, Maksym Veremeyenko wrote:
[...]
>> Am i wrong?
> 
> the correct solution is to use chained demuxers,
Could you clarify?

Should it be special case like:
[...]
     if(avi->non_interleaved){
[...]
         if (CONFIG_DV_DEMUXER && avi->dv_demux) {
[...]

I may be wrong, but it seems it useless since sync audio packet and 
video frames stores in the same DV frame for DV type 1 AVI.

> failing that, a single stream cant be non_interleaved whatever sets it
> is likely wrong

so if setted non_interleaved flag for DV type 1 AVI file is wrong?

may be it is possible to make some workaround for this:

a) either to clear non_interleaved flag in read_header:

Index: libavformat/avidec.c
===================================================================
--- libavformat/avidec.c	(revision 21221)
+++ libavformat/avidec.c	(working copy)
@@ -646,6 +646,8 @@
          avi_load_index(s);
      avi->index_loaded = 1;
      avi->non_interleaved |= guess_ni_flag(s);
+    if(CONFIG_DV_DEMUXER && avi->dv_demux)
+        avi->non_interleaved = 0;
      if(avi->non_interleaved) {
          av_log(s, AV_LOG_INFO, "non-interleaved AVI\n");
          clean_index(s);

b) or ignore non_interleaved section in read_packet:

Index: libavformat/avidec.c
===================================================================
--- libavformat/avidec.c	(revision 21217)
+++ libavformat/avidec.c	(working copy)
@@ -676,6 +676,7 @@
          int size = dv_get_packet(avi->dv_demux, pkt);
          if (size >= 0)
              return size;
+        goto resync;
      }

      if(avi->non_interleaved){


-- 
________________________________________
Maksym Veremeyenko



More information about the ffmpeg-devel mailing list