summaryrefslogtreecommitdiff
path: root/libavformat/format.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-07-29 21:38:15 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-07-29 21:38:15 +0200
commitd38edeee9b70f8c15ba549a40f8c72595513516e (patch)
tree96e3680a5065b2f0caeacdebcdb1e8e060235c1b /libavformat/format.c
parent4182728c787380c1eaf5bf599822d4a319f8c6a3 (diff)
avformat/format: fix memleak and error code
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/format.c')
-rw-r--r--libavformat/format.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/format.c b/libavformat/format.c
index 5f1e83c518..233fbd7c30 100644
--- a/libavformat/format.c
+++ b/libavformat/format.c
@@ -257,6 +257,7 @@ int av_probe_input_buffer2(AVIOContext *pb, AVInputFormat **fmt,
uint8_t *mime_type;
int ret = 0, probe_size, buf_offset = 0;
int score = 0;
+ int ret2;
if (!max_probe_size)
max_probe_size = PROBE_BUF_MAX;
@@ -331,8 +332,9 @@ int av_probe_input_buffer2(AVIOContext *pb, AVInputFormat **fmt,
fail:
/* Rewind. Reuse probe buffer to avoid seeking. */
+ ret2 = ffio_rewind_with_probe_data(pb, &buf, buf_offset);
if (ret >= 0)
- ret = ffio_rewind_with_probe_data(pb, &buf, buf_offset);
+ ret = ret2;
#if FF_API_PROBE_MIME
av_free(pd.mime_type);