mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-26 17:32:06 +00:00
Merge remote-tracking branch 'cehoyos/master'
* cehoyos/master: Avoid a null pointer dereference in avcodec_decode_video2(). Set block_align when reading QDM2 in mov. Fix muxing QDM2 mono into caf. Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
16310e36d9
@ -1920,6 +1920,8 @@ int attribute_align_arg avcodec_decode_video2(AVCodecContext *avctx, AVFrame *pi
|
||||
// copy to ensure we do not change avpkt
|
||||
AVPacket tmp = *avpkt;
|
||||
|
||||
if (!avctx->codec)
|
||||
return AVERROR(EINVAL);
|
||||
if (avctx->codec->type != AVMEDIA_TYPE_VIDEO) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Invalid media type for video\n");
|
||||
return AVERROR(EINVAL);
|
||||
|
@ -86,8 +86,9 @@ static uint32_t samples_per_packet(enum AVCodecID codec_id, int channels) {
|
||||
return 1152;
|
||||
case AV_CODEC_ID_AC3:
|
||||
return 1536;
|
||||
case AV_CODEC_ID_ALAC:
|
||||
case AV_CODEC_ID_QDM2:
|
||||
return 2048 * channels;
|
||||
case AV_CODEC_ID_ALAC:
|
||||
return 4096;
|
||||
case AV_CODEC_ID_ADPCM_IMA_WAV:
|
||||
return (1024 - 4 * channels) * 8 / (4 * channels) + 1;
|
||||
|
@ -1551,6 +1551,7 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries)
|
||||
case AV_CODEC_ID_ILBC:
|
||||
case AV_CODEC_ID_MACE3:
|
||||
case AV_CODEC_ID_MACE6:
|
||||
case AV_CODEC_ID_QDM2:
|
||||
st->codec->block_align = sc->bytes_per_frame;
|
||||
break;
|
||||
case AV_CODEC_ID_ALAC:
|
||||
|
Loading…
Reference in New Issue
Block a user