[Ffmpeg-devel] [PATCH] MP4 and MOV encoder support for files > 4GB

Dirk Musfeldt d.musfeldt
Mon Jan 23 12:50:48 CET 2006


Hi,

> Hi
> 
> On Mon, Jan 16, 2006 at 01:28:02PM +0100, Dirk Musfeldt wrote:
>> Hi,
>> 
>> OK, these are the modified regression tests...
> [...]
>>> 
>>>> +    if (j < UINT32_MAX) {
>>>> +        url_fseek(pb, mov->mdat_pos, SEEK_SET);
>>>> +        put_be32(pb, j+8);
>>> 
>>> j=UINT32_MAX - 1 -> j+8 > UINT32_MAX
> 
> and this issue?
> 
> if j is UINT32_MAX - 1 the body of the if() will be executed and j+8 will
> be stored but that is larger then UINT32_MAX and will overflow or did i
> miss something which prevents this?
> 
> [...]

No, of course you're right and I forgot to react on this issue from your
first mail. :-/

I changed this to

+    if (j+8 <= UINT32_MAX) {
+        url_fseek(pb, mov->mdat_pos, SEEK_SET);
+        put_be32(pb, j+8);


Please see the attached diff file.

Regards

Dirk


-------------- next part --------------
A non-text attachment was scrubbed...
Name: movenc.c.diff
Type: application/octet-stream
Size: 14892 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20060123/19253082/attachment.obj>



More information about the ffmpeg-devel mailing list