comparison wmaprodec.c @ 11540:6e1a61e42561 libavcodec

Make wmaprodec.c:decode_init() return AVERROR_INVALIDDATA / AVERROR_PATCHWELCOME in case of invalid / unsupported number of channels specified, rather than return AVERROR_NOTSUPP.
author stefano
date Thu, 25 Mar 2010 21:01:35 +0000
parents 98970e51365a
children ee30fc612763
comparison
equal deleted inserted replaced
11539:afe2ac7b175c 11540:6e1a61e42561
341 if (channel_mask & mask) 341 if (channel_mask & mask)
342 ++s->lfe_channel; 342 ++s->lfe_channel;
343 } 343 }
344 } 344 }
345 345
346 if (s->num_channels < 0 || s->num_channels > WMAPRO_MAX_CHANNELS) { 346 if (s->num_channels < 0) {
347 av_log_ask_for_sample(avctx, "invalid number of channels\n"); 347 av_log(avctx, AV_LOG_ERROR, "invalid number of channels %d\n", s->num_channels);
348 return AVERROR_NOTSUPP; 348 return AVERROR_INVALIDDATA;
349 } else if (s->num_channels > WMAPRO_MAX_CHANNELS) {
350 av_log_ask_for_sample(avctx, "unsupported number of channels\n");
351 return AVERROR_PATCHWELCOME;
349 } 352 }
350 353
351 INIT_VLC_STATIC(&sf_vlc, SCALEVLCBITS, HUFF_SCALE_SIZE, 354 INIT_VLC_STATIC(&sf_vlc, SCALEVLCBITS, HUFF_SCALE_SIZE,
352 scale_huffbits, 1, 1, 355 scale_huffbits, 1, 1,
353 scale_huffcodes, 2, 2, 616); 356 scale_huffcodes, 2, 2, 616);