[FFmpeg-devel] [PATCH] make packet_size in AVFormatContext unsigned

Ronald S. Bultje rsbultje
Wed Jun 17 21:08:04 CEST 2009


Hi,

On Wed, Jun 17, 2009 at 2:24 PM, Michael Niedermayer <michaelni at gmx.at>wrote:

> On Wed, Jun 17, 2009 at 09:45:01AM -0400, Ronald S. Bultje wrote:
>
[..
> so the max buffer size, and thus the max size of the packet data, should
fit
> 10+13 bytes, i.e. 1<<23 = 8MB (ok, ok, +10 bytes for the packet header).
Am
> I close here? Then the minimum size required is the size of the packet
> header, i.e. 10 bytes, and mpegenc.c makes assumptions that it is at least
> 10 bytes more than this, so 20 bytes.
>
> Attached patch OK?

probably, and even if not the packet size limits are not going to be an
> issue in practice, so ok


(I'd say that most demuxers I've seen won't even deal with multi-MB MPEG
packets, too high a chance that it's just a bunch of random bytes, but that
would then be a demuxer bug again.)

Anyway, applied. Thanks for the lesson. :-). Can I make packet_size unsigned
now? Looks safe to me.

Ronald
-------------- next part --------------
Index: ffmpeg-svn/libavformat/avformat.h
===================================================================
--- ffmpeg-svn.orig/libavformat/avformat.h	2009-06-16 17:42:55.000000000 -0400
+++ ffmpeg-svn/libavformat/avformat.h	2009-06-17 15:05:02.000000000 -0400
@@ -553,7 +553,7 @@
     int index_built;
 
     int mux_rate;
-    int packet_size;
+    unsigned int packet_size;
     int preload;
     int max_delay;
 



More information about the ffmpeg-devel mailing list