summaryrefslogtreecommitdiff
path: root/libavformat/options.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/options.c')
-rw-r--r--libavformat/options.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/options.c b/libavformat/options.c
index 8d7c4fe4cb..07403b533e 100644
--- a/libavformat/options.c
+++ b/libavformat/options.c
@@ -221,7 +221,10 @@ AVFormatContext *avformat_alloc_context(void)
return NULL;
}
internal->pkt = av_packet_alloc();
- if (!internal->pkt) {
+ internal->parse_pkt = av_packet_alloc();
+ if (!internal->pkt || !internal->parse_pkt) {
+ av_packet_free(&internal->pkt);
+ av_packet_free(&internal->parse_pkt);
av_free(internal);
av_free(ic);
return NULL;