Module: libav
Branch: release/0.7
Commit: ea5a5f09088c94d32492173c2fc39b8eb36e56d1

Author:    Laurent Aimar <[email protected]>
Committer: Reinhard Tartler <[email protected]>
Date:      Thu Oct  6 22:53:41 2011 +0200

segafilm: Check for memory allocation failures in segafilm demuxer.

Signed-off-by: Janne Grunau <[email protected]>
(cherry picked from commit 1775b92fee43f0527e2f5892a5a30450fa929722)

Signed-off-by: Anton Khirnov <[email protected]>

---

 libavformat/segafilm.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/libavformat/segafilm.c b/libavformat/segafilm.c
index 0ad5fbb..6cd0615 100644
--- a/libavformat/segafilm.c
+++ b/libavformat/segafilm.c
@@ -238,6 +238,10 @@ static int film_read_packet(AVFormatContext *s,
             av_free(film->stereo_buffer);
             film->stereo_buffer_size = sample->sample_size;
             film->stereo_buffer = av_malloc(film->stereo_buffer_size);
+            if (!film->stereo_buffer) {
+                film->stereo_buffer_size = 0;
+                return AVERROR(ENOMEM);
+            }
         }
 
         pkt->pos= avio_tell(pb);

_______________________________________________
libav-commits mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-commits

Reply via email to