summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libavformat/bit.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/bit.c b/libavformat/bit.c
index 03c6152c5d..9f6ea4a415 100644
--- a/libavformat/bit.c
+++ b/libavformat/bit.c
@@ -90,7 +90,8 @@ static int read_packet(AVFormatContext *s,
if(ret != 8 * packet_size * sizeof(uint16_t))
return AVERROR(EIO);
- av_new_packet(pkt, packet_size);
+ if (av_new_packet(pkt, packet_size) < 0)
+ return AVERROR(ENOMEM);
init_put_bits(&pbo, pkt->data, packet_size);
for(j=0; j < packet_size; j++)