mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-04-14 00:58:38 +02:00
avformat/matroskadec: Remove redundant checks
If the size of the data of an EbmlBin is > 0, its data is always present, as ebml_read_binary() always leaves the buffer in a consistent state (even on error). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
parent
8ecd1b80d1
commit
9d3c4170c5
@ -2523,8 +2523,7 @@ static int mka_parse_audio_codec(MatroskaTrack *track, AVCodecParameters *par,
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!strcmp(track->codec_id, "A_MS/ACM") &&
|
if (!strcmp(track->codec_id, "A_MS/ACM") &&
|
||||||
track->codec_priv.size >= 14 &&
|
track->codec_priv.size >= 14) {
|
||||||
track->codec_priv.data) {
|
|
||||||
FFIOContext b;
|
FFIOContext b;
|
||||||
int ret;
|
int ret;
|
||||||
ffio_init_context(&b, track->codec_priv.data,
|
ffio_init_context(&b, track->codec_priv.data,
|
||||||
@ -2538,8 +2537,7 @@ static int mka_parse_audio_codec(MatroskaTrack *track, AVCodecParameters *par,
|
|||||||
return 0;
|
return 0;
|
||||||
} else if (!strcmp(track->codec_id, "A_QUICKTIME")
|
} else if (!strcmp(track->codec_id, "A_QUICKTIME")
|
||||||
/* Normally 36, but allow noncompliant private data */
|
/* Normally 36, but allow noncompliant private data */
|
||||||
&& (track->codec_priv.size >= 32)
|
&& track->codec_priv.size >= 32) {
|
||||||
&& (track->codec_priv.data)) {
|
|
||||||
enum AVCodecID codec_id;
|
enum AVCodecID codec_id;
|
||||||
uint32_t fourcc;
|
uint32_t fourcc;
|
||||||
uint16_t sample_size;
|
uint16_t sample_size;
|
||||||
@ -2939,8 +2937,7 @@ static int matroska_parse_tracks(AVFormatContext *s)
|
|||||||
continue;
|
continue;
|
||||||
} else
|
} else
|
||||||
if (!strcmp(track->codec_id, "V_MS/VFW/FOURCC") &&
|
if (!strcmp(track->codec_id, "V_MS/VFW/FOURCC") &&
|
||||||
track->codec_priv.size >= 40 &&
|
track->codec_priv.size >= 40) {
|
||||||
track->codec_priv.data) {
|
|
||||||
track->ms_compat = 1;
|
track->ms_compat = 1;
|
||||||
par->bits_per_coded_sample = AV_RL16(track->codec_priv.data + 14);
|
par->bits_per_coded_sample = AV_RL16(track->codec_priv.data + 14);
|
||||||
par->codec_tag = AV_RL32(track->codec_priv.data + 16);
|
par->codec_tag = AV_RL32(track->codec_priv.data + 16);
|
||||||
@ -2951,8 +2948,7 @@ static int matroska_parse_tracks(AVFormatContext *s)
|
|||||||
par->codec_tag);
|
par->codec_tag);
|
||||||
extradata_offset = 40;
|
extradata_offset = 40;
|
||||||
} else if (!strcmp(track->codec_id, "V_QUICKTIME") &&
|
} else if (!strcmp(track->codec_id, "V_QUICKTIME") &&
|
||||||
(track->codec_priv.size >= 21) &&
|
track->codec_priv.size >= 21) {
|
||||||
(track->codec_priv.data)) {
|
|
||||||
uint32_t fourcc;
|
uint32_t fourcc;
|
||||||
int ret = get_qt_codec(track, &fourcc, &codec_id);
|
int ret = get_qt_codec(track, &fourcc, &codec_id);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user