diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2023-08-09 16:58:34 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2023-09-07 00:28:27 +0200 |
commit | 9d3c4170c5e50fbdb2a2972a22e9b785a198f7c7 (patch) | |
tree | 9b9f1e152bae565e62107d7f6ce801e90009c57a | |
parent | 8ecd1b80d1d97d690b6a1a4ee17a3a3c4222cc66 (diff) |
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>
-rw-r--r-- | libavformat/matroskadec.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 8846e9358d..e30dedf434 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -2523,8 +2523,7 @@ static int mka_parse_audio_codec(MatroskaTrack *track, AVCodecParameters *par, int ret; if (!strcmp(track->codec_id, "A_MS/ACM") && - track->codec_priv.size >= 14 && - track->codec_priv.data) { + track->codec_priv.size >= 14) { FFIOContext b; int ret; ffio_init_context(&b, track->codec_priv.data, @@ -2538,8 +2537,7 @@ static int mka_parse_audio_codec(MatroskaTrack *track, AVCodecParameters *par, return 0; } else if (!strcmp(track->codec_id, "A_QUICKTIME") /* Normally 36, but allow noncompliant private data */ - && (track->codec_priv.size >= 32) - && (track->codec_priv.data)) { + && track->codec_priv.size >= 32) { enum AVCodecID codec_id; uint32_t fourcc; uint16_t sample_size; @@ -2939,8 +2937,7 @@ static int matroska_parse_tracks(AVFormatContext *s) continue; } else if (!strcmp(track->codec_id, "V_MS/VFW/FOURCC") && - track->codec_priv.size >= 40 && - track->codec_priv.data) { + track->codec_priv.size >= 40) { track->ms_compat = 1; par->bits_per_coded_sample = AV_RL16(track->codec_priv.data + 14); par->codec_tag = AV_RL32(track->codec_priv.data + 16); @@ -2951,8 +2948,7 @@ static int matroska_parse_tracks(AVFormatContext *s) par->codec_tag); extradata_offset = 40; } else if (!strcmp(track->codec_id, "V_QUICKTIME") && - (track->codec_priv.size >= 21) && - (track->codec_priv.data)) { + track->codec_priv.size >= 21) { uint32_t fourcc; int ret = get_qt_codec(track, &fourcc, &codec_id); if (ret < 0) |