[FFmpeg-devel] [PATCH] Only check for invalid codec_id if the codec tag was supposed to be in the current packet.

Michael Niedermayer michaelni
Tue Jan 18 16:16:34 CET 2011


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)

also the codec_id code a bit above coule be factored out

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The real ebay dictionary, page 3
"Rare item" - "Common item with rare defect or maybe just a lie"
"Professional" - "'Toy' made in china, not functional except as doorstop"
"Experts will know" - "The seller hopes you are not an expert"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20110118/6124d602/attachment.pgp>



More information about the ffmpeg-devel mailing list