mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2026-01-23 23:21:06 +01:00
alac: do not return success if nothing was decoded
If we encounter an END element before anything is decoded, we would return success even though the output frame has not been allocated, which is invalid. CC: libav-stable@libav.org Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
This commit is contained in:
parent
f5d46d3322
commit
796dca027b
1 changed files with 4 additions and 0 deletions
|
|
@ -447,6 +447,10 @@ static int alac_decode_frame(AVCodecContext *avctx, void *data,
|
|||
av_log(avctx, AV_LOG_ERROR, "no end tag found. incomplete packet.\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
if (!alac->nb_samples) {
|
||||
av_log(avctx, AV_LOG_ERROR, "No decodable data in the packet\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
if (avpkt->size * 8 - get_bits_count(&alac->gb) > 8) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Error : %d bits left\n",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue