[FFmpeg-cvslog] bit: check av_new_packet() return value

Paul B Mahol git at videolan.org
Fri Oct 26 17:36:01 CEST 2012


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Fri Oct 26 15:31:00 2012 +0000| [adc61d68b02cf91b594400e502c7786da1e02e11] | committer: Paul B Mahol

bit: check av_new_packet() return value

Fixes CID703626.

Signed-off-by: Paul B Mahol <onemda at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=adc61d68b02cf91b594400e502c7786da1e02e11
---

 libavformat/bit.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/bit.c b/libavformat/bit.c
index 03c6152..9f6ea4a 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++)



More information about the ffmpeg-cvslog mailing list