aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-01-11 04:58:29 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-01-11 05:17:44 +0100
commitaa6545e1f30e6f0aa7ad7498f524190b978b4e02 (patch)
treec7dd27d8b56e07f458abaa4b25129e27f1411171
parent6abf00d615d2098d67faeb9b034265c9983bbefd (diff)
downloadffmpeg-aa6545e1f30e6f0aa7ad7498f524190b978b4e02.tar.gz
avformat/hlsenc: more robust error tests
errors are negative throughout ffmpeg Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/hlsenc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index a76dbce6e1..29bf30e192 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -395,7 +395,7 @@ static int hls_write_header(AVFormatContext *s)
fail:
av_dict_free(&options);
- if (ret) {
+ if (ret < 0) {
av_freep(&hls->basename);
if (hls->avf)
avformat_free_context(hls->avf);
@@ -438,7 +438,7 @@ static int hls_write_packet(AVFormatContext *s, AVPacket *pkt)
hls->size = new_start_pos - hls->start_pos;
ret = hls_append_segment(hls, hls->duration, hls->start_pos, hls->size);
hls->start_pos = new_start_pos;
- if (ret)
+ if (ret < 0)
return ret;
hls->end_pts = pkt->pts;
@@ -454,7 +454,7 @@ static int hls_write_packet(AVFormatContext *s, AVPacket *pkt)
ret = hls_start(s);
}
- if (ret)
+ if (ret < 0)
return ret;
oc = hls->avf;