]> git.sesse.net Git - ffmpeg/commitdiff
avformat/genh: Check av_new_packet() return value
authorMichael Niedermayer <michael@niedermayer.cc>
Sat, 17 Oct 2015 00:44:43 +0000 (02:44 +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/genh.c

index 103912bf98361d5c4dd8ffa9fd47ac18445b9410..3a4faf915202b50838a695b62eac00367870b27e 100644 (file)
@@ -153,7 +153,9 @@ static int genh_read_packet(AVFormatContext *s, AVPacket *pkt)
 
         if (avio_feof(s->pb))
             return AVERROR_EOF;
-        av_new_packet(pkt, 8 * codec->channels);
+        ret = av_new_packet(pkt, 8 * codec->channels);
+        if (ret < 0)
+            return ret;
         for (i = 0; i < 8 / c->interleave_size; i++) {
             for (ch = 0; ch < codec->channels; ch++) {
                 pkt->data[ch * 8 + i*c->interleave_size+0] = avio_r8(s->pb);