All codecs here have a valid sample size at this point. This check has (presumably) been added for DVD PCM, but even for them the check was always-true after 381e195b46d080aee1d9b05ef2b6b140e9463519 (and the DVD code was later moved out altogether). So just remove this check and the leftover DVD comment.
Unified · Split
| @@ -334,7 +334,6 @@ static int pcm_decode_frame(AVCodecContext *avctx, AVFrame *frame, · 333 unmodified lines | |||
| 334 | 334 | ||
| 335 | sample_size = av_get_bits_per_sample(avctx->codec_id) / 8; | 335 | sample_size = av_get_bits_per_sample(avctx->codec_id) / 8; |
| 336 | 336 | ||
| 337 | /* av_get_bits_per_sample returns 0 for AV_CODEC_ID_PCM_DVD */ | ||
| 338 | samples_per_block = 1; | 337 | samples_per_block = 1; |
| 339 | if (avctx->codec_id == AV_CODEC_ID_PCM_LXF) { | 338 | if (avctx->codec_id == AV_CODEC_ID_PCM_LXF) { |
| 340 | /* we process 40-bit blocks per channel for LXF */ | 339 | /* we process 40-bit blocks per channel for LXF */ |
| @@ -342,11 +341,6 @@ static int pcm_decode_frame(AVCodecContext *avctx, AVFrame *frame, · 1 unmodified line | |||
| 342 | sample_size = 5; | 341 | sample_size = 5; |
| 343 | } | 342 | } |
| 344 | 343 | ||
| 345 | if (sample_size == 0) { | ||
| 346 | av_log(avctx, AV_LOG_ERROR, "Invalid sample_size\n"); | ||
| 347 | return AVERROR(EINVAL); | ||
| 348 | } | ||
| 349 | |||
| 350 | if (channels == 0) { | 344 | if (channels == 0) { |
| 351 | av_log(avctx, AV_LOG_ERROR, "Invalid number of channels\n"); | 345 | av_log(avctx, AV_LOG_ERROR, "Invalid number of channels\n"); |
| 352 | return AVERROR(EINVAL); | 346 | return AVERROR(EINVAL); |