On Sat, Jul 09, 2011 at 11:20:18AM +0200, Anton Khirnov wrote:
> --- a/libavformat/wav.c
> +++ b/libavformat/wav.c
> @@ -336,7 +336,8 @@ static int wav_read_header(AVFormatContext *s,
>          size = next_tag(pb, &tag);
>          next_tag_ofs = avio_tell(pb) + size;
>  
> -        if (tag == MKTAG('f', 'm', 't', ' ')) {
> +        switch (tag) {
> +        case MKTAG('f', 'm', 't', ' '):
>              /* only parse the first 'fmt ' tag found */
>              if (!got_fmt && (ret = wav_parse_fmt_tag(s, size, &st) < 0)) {
>                  return ret;
> @@ -344,18 +345,22 @@ static int wav_read_header(AVFormatContext *s,
>                  av_log(s, AV_LOG_WARNING, "found more than one 'fmt ' 
> tag\n");
>  
>              got_fmt = 1;
> -        } else if (tag == MKTAG('d', 'a', 't', 'a')) {
> +            break;
> +        case MKTAG('d', 'a', 't', 'a'):
>              if (!got_fmt) {
>                  av_log(s, AV_LOG_ERROR, "found no 'fmt ' tag before the 
> 'data' tag\n");
>                  return AVERROR_INVALIDDATA;
>              }
>  
> -            break;
> -        }else if (tag == MKTAG('f','a','c','t') && !sample_count){
> +            goto break_loop;
> +        case MKTAG('f','a','c','t'):
> +            if(!sample_count)
>              sample_count = avio_rl32(pb);

if (

And please reindent that line right away.

Looks OK otherwise even though I'm not terribly fond of the goto.

Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to