On Sat, Sep 17, 2011 at 04:56:34PM +0200, [email protected] wrote:
> From: Laurent Aimar <[email protected]>
> 
> ---
>  libavformat/rmdec.c |   38 ++++++++++++++++++++++++++------------
>  1 files changed, 26 insertions(+), 12 deletions(-)
> 
> diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c
> index 81f563e..9c10852 100644
> --- a/libavformat/rmdec.c
> +++ b/libavformat/rmdec.c
> @@ -194,18 +194,6 @@ static int rm_read_audio_stream_info(AVFormatContext *s, 
> AVIOContext *pb,
>          st->codec->codec_id   = ff_codec_get_id(ff_rm_codec_tags,
>                                                  st->codec->codec_tag);
>  
> -        switch (ast->deint_id) {
> -        case DEINT_ID_GENR:
> -        case DEINT_ID_INT0:
> -        case DEINT_ID_INT4:
> -        case DEINT_ID_SIPR:
> -        case DEINT_ID_VBRS:
> -        case DEINT_ID_VBRF:
> -            break;
> -        default:
> -            av_log(NULL,0,"Unknown interleaver %X\n", ast->deint_id);
> -            return AVERROR_INVALIDDATA;
> -        }
>          switch (st->codec->codec_id) {
>          case CODEC_ID_AC3:
>              st->need_parsing = AVSTREAM_PARSE_FULL;
> @@ -279,6 +267,32 @@ static int rm_read_audio_stream_info(AVFormatContext *s, 
> AVIOContext *pb,
>          default:
>              av_strlcpy(st->codec->codec_name, buf, 
> sizeof(st->codec->codec_name));
>          }
> +        switch (ast->deint_id) {
> +        case DEINT_ID_INT4:
> +            if (ast->coded_framesize > ast->audio_framesize ||
> +                ast->sub_packet_h * ast->coded_framesize > (2 + 
> (ast->sub_packet_h & 1)) * ast->audio_framesize ||
> +                !ast->pkt.data)
> +                return AVERROR_INVALIDDATA;
> +            break;
> +        case DEINT_ID_GENR:
> +            if (ast->sub_packet_size <= 0 ||
> +                ast->sub_packet_size > ast->audio_framesize ||
> +                !ast->pkt.data)
> +                return AVERROR_INVALIDDATA;
> +            break;
> +        case DEINT_ID_SIPR:
> +            if (!ast->pkt.data)
> +                return AVERROR_INVALIDDATA;
> +            break;

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

Reply via email to