summaryrefslogtreecommitdiff
path: root/libavformat/applehttp.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-12-14 23:58:10 +0100
committerMichael Niedermayer <michaelni@gmx.at>2011-12-14 23:58:10 +0100
commite462257242fc037c99206457d1316e1ff9e5306f (patch)
tree045910517a8b587f7a016b1c46403e1d1021f4f2 /libavformat/applehttp.c
parenta1be5bc79d7ac4c7c7ed79c4d72b4f1945ecb55c (diff)
parent115a57302a7d6661426304bec3a5bc72d0edf4b0 (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: (23 commits) applehttp: Properly clean up if unable to probe a segment applehttp: Avoid reading uninitialized memory fate: Replace misleading "aac" in the name of an ADTS test with "adts". fate: Drop pointless "-an" from pictor test command. fate: split off image codec FATE tests into their own file fate: split off WMA codec FATE tests into their own file fate: split off lossless video and audio FATE tests into their own files fate: split off qtrle codec FATE tests into their own file fate: split off Ut Video codec FATE tests into their own file fate: split off screen codec FATE tests into their own file fate: split off Real Inc. codec FATE tests into their own file fate: split off AC-3 codec FATE tests into their own file mpegvideo: remove abort() in ff_find_unused_picture() rv40: NEON optimised loop filter strength selection rv40: rearrange loop filter functions configure: cosmetics: sort some lists where appropriate swscale_mmx: drop no longer required parameters from VSCALEX macros swscale: Mark yuv2planeX_8_mmx as MMX2; it contains MMX2 instructions. build: conditionally compile x86 H.264 chroma optimizations v410 encoder and decoder ... Conflicts: Changelog configure doc/developer.texi doc/general.texi libavcodec/arm/asm.S libavcodec/avcodec.h libavcodec/v410dec.c libavcodec/v410enc.c libavcodec/version.h libavcodec/x86/Makefile libavcodec/x86/dsputil_mmx.c libswscale/x86/swscale_mmx.c tests/Makefile tests/fate2.mak Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/applehttp.c')
-rw-r--r--libavformat/applehttp.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/libavformat/applehttp.c b/libavformat/applehttp.c
index be8ea32416..99febc6d95 100644
--- a/libavformat/applehttp.c
+++ b/libavformat/applehttp.c
@@ -204,7 +204,7 @@ static int parse_playlist(AppleHTTPContext *c, const char *url,
enum KeyType key_type = KEY_NONE;
uint8_t iv[16] = "";
int has_iv = 0;
- char key[MAX_URL_SIZE];
+ char key[MAX_URL_SIZE] = "";
char line[1024];
const char *ptr;
int close_in = 0;
@@ -503,8 +503,15 @@ static int applehttp_read_header(AVFormatContext *s, AVFormatParameters *ap)
v->pb.seekable = 0;
ret = av_probe_input_buffer(&v->pb, &in_fmt, v->segments[0]->url,
NULL, 0, 0);
- if (ret < 0)
+ if (ret < 0) {
+ /* Free the ctx - it isn't initialized properly at this point,
+ * so avformat_close_input shouldn't be called. If
+ * avformat_open_input fails below, it frees and zeros the
+ * context, so it doesn't need any special treatment like this. */
+ avformat_free_context(v->ctx);
+ v->ctx = NULL;
goto fail;
+ }
v->ctx->pb = &v->pb;
ret = avformat_open_input(&v->ctx, v->segments[0]->url, in_fmt, NULL);
if (ret < 0)