[FFmpeg-cvslog] avformat/genh: Check av_new_packet() return value
Michael Niedermayer
git at videolan.org
Sat Oct 17 12:59:24 CEST 2015
ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sat Oct 17 02:44:43 2015 +0200| [acf23d9451e9ea014a4eddf2abdb476c4f33edc4] | committer: Michael Niedermayer
avformat/genh: Check av_new_packet() return value
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=acf23d9451e9ea014a4eddf2abdb476c4f33edc4
---
libavformat/genh.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/libavformat/genh.c b/libavformat/genh.c
index 103912b..3a4faf9 100644
--- a/libavformat/genh.c
+++ b/libavformat/genh.c
@@ -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);
More information about the ffmpeg-cvslog
mailing list