diff --git a/libavdevice/openal-dec.c b/libavdevice/openal-dec.c index 4c4ba28c22..37d321a35d 100644 --- a/libavdevice/openal-dec.c +++ b/libavdevice/openal-dec.c @@ -192,7 +192,8 @@ static int read_packet(AVFormatContext* ctx, AVPacket *pkt) if (error = al_get_error(ad->device, &error_msg)) goto fail; /* Create a packet of appropriate size */ - av_new_packet(pkt, nb_samples*ad->sample_step); + if ((error = av_new_packet(pkt, nb_samples*ad->sample_step)) < 0) + goto fail; pkt->pts = av_gettime(); /* Fill the packet with the available samples */