[FFmpeg-devel] [PATCH] Only check for invalid codec_id if the codec tag was supposed to be in the current packet.
Justin Ruggles
justin.ruggles
Tue Jan 18 19:09:26 CET 2011
On 01/18/2011 12:25 PM, Michael Niedermayer wrote:
> On Tue, Jan 18, 2011 at 12:14:43PM -0500, Justin Ruggles wrote:
>> On 01/18/2011 10:21 AM, Michael Niedermayer wrote:
>>
>>> On Tue, Jan 18, 2011 at 04:16:34PM +0100, Michael Niedermayer wrote:
>>>> On Tue, Jan 18, 2011 at 08:55:33AM -0500, Justin Ruggles wrote:
>>>>>
>>>>> Fixes decoding of stereo VOC files.
>>>>> ---
>>>>> libavformat/vocdec.c | 3 ++-
>>>>> 1 files changed, 2 insertions(+), 1 deletions(-)
>>>>>
>>>>
>>>>> vocdec.c | 3 ++-
>>>>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>>>> 1e38294ad07cc0f39e1941852b13ad42997debe5 0001-Only-check-for-invalid-codec_id-if-the-codec-tag-was.patch
>>>>> diff --git a/libavformat/vocdec.c b/libavformat/vocdec.c
>>>>> index 7cc37f0..1a77a4b 100644
>>>>> --- a/libavformat/vocdec.c
>>>>> +++ b/libavformat/vocdec.c
>>>>> @@ -133,7 +133,8 @@ voc_get_packet(AVFormatContext *s, AVPacket *pkt, AVStream *st, int max_size)
>>>>> voc->remaining_size = 0;
>>>>> break;
>>>>> }
>>>>> - if (dec->codec_id == CODEC_ID_NONE) {
>>>>> + if ((type == VOC_TYPE_VOICE_DATA || type == VOC_TYPE_NEW_VOICE_DATA) &&
>>>>> + dec->codec_id == CODEC_ID_NONE) {
>>>>> av_log(s, AV_LOG_ERROR, "Invalid codec_id\n");
>>>>
>>>> this check still looks wrong to me
>>>> (example is if there is no such packet at all)
>>>
>>> to clarify, the patch is ok as such it improves things but it doesnt fully
>>> fix this check
>>
>>
>> new patch.
>>
>
>> vocdec.c | 29 ++++++++++++++++-------------
>> vocenc.c | 2 +-
>> 2 files changed, 17 insertions(+), 14 deletions(-)
>> 5298d56892179038da29cc55b230910108b9b220 0001-Revise-check-for-codec-id-in-voc-demuxer.patch
>> From b1f04b1ac36a822b6161fd96d02e74df3d5925df Mon Sep 17 00:00:00 2001
>> From: Justin Ruggles <justin.ruggles at gmail.com>
>> Date: Tue, 18 Jan 2011 12:09:42 -0500
>> Subject: [PATCH] Revise check for codec id in voc demuxer.
>> MIME-Version: 1.0
>> Content-Type: multipart/mixed; boundary="------------1.7.0.4"
>>
>> This is a multi-part message in MIME format.
>> --------------1.7.0.4
>> Content-Type: text/plain; charset=UTF-8; format=fixed
>> Content-Transfer-Encoding: 8bit
>>
>>
>> This fixes demuxing of packets that do not contain a codec tag and come before the codec_id has been set.
>> ---
>> libavformat/vocdec.c | 29 ++++++++++++++++-------------
>> libavformat/vocenc.c | 2 +-
>> 2 files changed, 17 insertions(+), 14 deletions(-)
>
> lgtm without last hunk if tested
applied.
More information about the ffmpeg-devel
mailing list