summaryrefslogtreecommitdiff
path: root/libavdevice/alsa.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavdevice/alsa.c')
-rw-r--r--libavdevice/alsa.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavdevice/alsa.c b/libavdevice/alsa.c
index 117b2ea144..ee282fac16 100644
--- a/libavdevice/alsa.c
+++ b/libavdevice/alsa.c
@@ -286,6 +286,10 @@ av_cold int ff_alsa_open(AVFormatContext *ctx, snd_pcm_stream_t mode,
}
}
+ s->pkt = av_packet_alloc();
+ if (!s->pkt)
+ goto fail1;
+
s->h = h;
return 0;
@@ -308,6 +312,7 @@ av_cold int ff_alsa_close(AVFormatContext *s1)
if (CONFIG_ALSA_INDEV)
ff_timefilter_destroy(s->timefilter);
snd_pcm_close(s->h);
+ av_packet_free(&s->pkt);
return 0;
}