[FFmpeg-devel] [PATCH] fix the SAMPLE_FMT_NONE case in ffmdec.c

Ronald S. Bultje rsbultje
Tue Mar 16 17:19:13 CET 2010


Hi Peter,

On Tue, Mar 16, 2010 at 2:34 AM, Peter Ross <pross at xvid.org> wrote:
> On Mon, Mar 15, 2010 at 04:15:10PM -0400, Ronald S. Bultje wrote:
>> --- libavformat/ffmdec.c ? ? ?(revision 22550)
>> +++ libavformat/ffmdec.c ? ? ?(working copy)
>> @@ -355,6 +355,8 @@
>> ? ? ? ? ? ? ?codec->channels = get_le16(pb);
>> ? ? ? ? ? ? ?codec->frame_size = get_le16(pb);
>
>> ? ? ? ? ? ? ?codec->sample_fmt = get_le16(pb);
>> + ? ? ? ? ? ?if (codec->sample_fmt == (1 << 16) - 1)
>> + ? ? ? ? ? ? ? ?codec->sample_fmt = -1;
>
> why not read it as a signed 16-bit integer? e.g.
> ? ? ? ?codec->sample_fmt = sign_extend( get_le16(), 16 )

True, I didn't know it existed, thanks for the pointer. New patch
attached (works the same as previous).

Ronald
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix-ffm-no_sample_fmt.patch
Type: text/x-patch
Size: 684 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100316/ad4b2231/attachment.bin>



More information about the ffmpeg-devel mailing list