Quoting Martijn van Beurden (2022-06-04 12:35:06) > @@ -170,6 +171,49 @@ static int read_kuki_chunk(AVFormatContext *s, int64_t > size) > } > avio_skip(pb, size - ALAC_NEW_KUKI); > } > + } else if (st->codecpar->codec_id == AV_CODEC_ID_FLAC) { > + int last, type, flac_metadata_size; > + uint8_t buf[4]; > + /* The magic cookie format for FLAC consists mostly of an mp4 dfLa > atom. */ > + if (size < (16 + FLAC_STREAMINFO_SIZE)) { > + av_log(s, AV_LOG_ERROR, "invalid FLAC magic cookie\n"); > + return AVERROR_INVALIDDATA; > + } > + /* Check cookie version. */ > + if (avio_r8(pb) != 0) { > + av_log(s, AV_LOG_ERROR, "unknown FLAC magic cookie\n"); > + return AVERROR_INVALIDDATA; > + } > + avio_rb24(pb); /* Flags */ > + /* read dfLa fourcc */ > + if (avio_read(pb, buf, 4) != 4) { > + av_log(s, AV_LOG_ERROR, "failed to read FLAC magic cookie\n"); > + return AVERROR_INVALIDDATA;
Should probably forward the IO error with something like return (pb->error < 0 ? pb->error : AVERROR_INVALIDDATA); same below and in the second patch -- Anton Khirnov _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".