[Ffmpeg-devel] [PATCH] fix seg fault in mov_read_header

Limin Wang lance.lmwang
Wed Jan 24 09:59:12 CET 2007


Hi,

Attached patch want to fix access invalid NULL pointer in case no stts box
describe. Please review it.


Thanks,
Limin


-------------- next part --------------
Index: libavformat/mov.c
===================================================================
--- libavformat/mov.c	(revision 7639)
+++ libavformat/mov.c	(working copy)
@@ -1510,6 +1510,10 @@
                         st->index, current_sample, current_offset, current_dts, sample_size, distance, keyframe);
                 av_add_index_entry(st, current_offset, current_dts, sample_size, distance, keyframe ? AVINDEX_KEYFRAME : 0);
                 current_offset += sample_size;
+
+                /* check the stts box range */
+                if(stts_index >= sc->stts_count )
+                    break;
                 assert(sc->stts_data[stts_index].duration % sc->time_rate == 0);
                 current_dts += sc->stts_data[stts_index].duration / sc->time_rate;
                 distance++;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 481 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070124/66fe4ca8/attachment.pgp>



More information about the ffmpeg-devel mailing list