Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2019-11-29 22:44:11 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2019-12-01 19:17:04 +0300
commit5946243fa8930d91ac96fb21daa0959548ac0ce4 (patch)
tree98a0dd7cf12fd22e8331c6f2a98c403a524b08aa /libavformat/flac_picture.c
parent84a4261cd842b86782bac87bf474a9ce566e10df (diff)
avformat/flac_picture: Return directly if nothing has been allocated
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/flac_picture.c')
-rw-r--r--libavformat/flac_picture.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libavformat/flac_picture.c b/libavformat/flac_picture.c
index ccb0ee613e..81ddf80465 100644
--- a/libavformat/flac_picture.c
+++ b/libavformat/flac_picture.c
@@ -52,7 +52,7 @@ int ff_flac_parse_picture(AVFormatContext *s, uint8_t *buf, int buf_size)
if (type >= FF_ARRAY_ELEMS(ff_id3v2_picture_types)) {
av_log(s, AV_LOG_ERROR, "Invalid picture type: %d.\n", type);
if (s->error_recognition & AV_EF_EXPLODE) {
- RETURN_ERROR(AVERROR_INVALIDDATA);
+ return AVERROR_INVALIDDATA;
}
type = 0;
}
@@ -63,8 +63,8 @@ int ff_flac_parse_picture(AVFormatContext *s, uint8_t *buf, int buf_size)
av_log(s, AV_LOG_ERROR, "Could not read mimetype from an attached "
"picture.\n");
if (s->error_recognition & AV_EF_EXPLODE)
- ret = AVERROR_INVALIDDATA;
- goto fail;
+ return AVERROR_INVALIDDATA;
+ return 0;
}
if (len + 24 > bytestream2_get_bytes_left(&g)) {
av_log(s, AV_LOG_ERROR, "Attached picture metadata block too short\n");
@@ -86,8 +86,8 @@ int ff_flac_parse_picture(AVFormatContext *s, uint8_t *buf, int buf_size)
av_log(s, AV_LOG_ERROR, "Unknown attached picture mimetype: %s.\n",
mimetype);
if (s->error_recognition & AV_EF_EXPLODE)
- ret = AVERROR_INVALIDDATA;
- goto fail;
+ return AVERROR_INVALIDDATA;
+ return 0;
}
/* picture description */
@@ -100,7 +100,7 @@ int ff_flac_parse_picture(AVFormatContext *s, uint8_t *buf, int buf_size)
}
if (len > 0) {
if (!(desc = av_malloc(len + 1))) {
- RETURN_ERROR(AVERROR(ENOMEM));
+ return AVERROR(ENOMEM);
}
bytestream2_get_bufferu(&g, desc, len);