OSDN Git Service

avformat/rsd: Check av_new_packet() return value
authorMichael Niedermayer <michael@niedermayer.cc>
Sat, 17 Oct 2015 10:11:16 +0000 (12:11 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Sat, 17 Oct 2015 10:56:47 +0000 (12:56 +0200)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/rsd.c

index 99912be..6b2016b 100644 (file)
@@ -169,7 +169,9 @@ static int rsd_read_packet(AVFormatContext *s, AVPacket *pkt)
                codec->channels > 1) {
         int i, ch;
 
-        av_new_packet(pkt, codec->block_align);
+        ret = av_new_packet(pkt, codec->block_align);
+        if (ret < 0)
+            return ret;
         for (i = 0; i < 4; i++) {
             for (ch = 0; ch < codec->channels; ch++) {
                 pkt->data[ch * 8 + i * 2 + 0] = avio_r8(s->pb);