[FFmpeg-devel] [PATCH 2/2] g2meet: factor out chunk seeking

Maxim Polijakowski max_pole at gmx.de
Sat Feb 8 23:03:23 CET 2014


Am 08.02.2014 22:45, schrieb Michael Niedermayer:
> On Sat, Feb 08, 2014 at 10:27:51PM +0100, Maxim Poliakovski wrote:
>> This version requires fewer code and is safer.
>> ---
>>   libavcodec/g2meet.c |   21 ++++++++-------------
>>   1 file changed, 8 insertions(+), 13 deletions(-)
>>
>> diff --git a/libavcodec/g2meet.c b/libavcodec/g2meet.c
>> index b982eab..c2fceda 100644
>> --- a/libavcodec/g2meet.c
>> +++ b/libavcodec/g2meet.c
>> @@ -646,7 +646,7 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
>>       int magic;
>>       int got_header = 0;
>>       uint32_t chunk_size;
>> -    int chunk_type;
>> +    int chunk_type, chunk_start;
> chunk_start should be 64bit as file positions could be 64bit in theory
> also chunk_start + chunk_size could overflow if they are both 32bit

Because we're working with frame data wrapped into a bytestream, 
chunk_start and chunk_size indicate some position within a single frame, 
which data size is very unlikely to be bigger than 2^32 bits.
There are no file operations performed at all. Perhaps the word 
"seeking" was abit misleading here...

Best regards
Maxim


More information about the ffmpeg-devel mailing list