[FFmpeg-cvslog] ffplay: cast vp->height to int64 in buffer size check

Marton Balint git at videolan.org
Mon Jun 17 02:51:47 CEST 2013


ffmpeg | branch: master | Marton Balint <cus at passwd.hu> | Tue Jun  4 23:23:09 2013 +0200| [f73d6d2af7a2b30a647d945b590962a2ab54ff3b] | committer: Marton Balint

ffplay: cast vp->height to int64 in buffer size check

Fixes Coverity CID 1026769 and 1026756.

Signed-off-by: Marton Balint <cus at passwd.hu>

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

 ffplay.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ffplay.c b/ffplay.c
index 26a813b..65b7cb0 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -1518,7 +1518,7 @@ static void alloc_picture(VideoState *is)
                                    SDL_YV12_OVERLAY,
                                    screen);
     bufferdiff = vp->bmp ? FFMAX(vp->bmp->pixels[0], vp->bmp->pixels[1]) - FFMIN(vp->bmp->pixels[0], vp->bmp->pixels[1]) : 0;
-    if (!vp->bmp || vp->bmp->pitches[0] < vp->width || bufferdiff < vp->height * vp->bmp->pitches[0]) {
+    if (!vp->bmp || vp->bmp->pitches[0] < vp->width || bufferdiff < (int64_t)vp->height * vp->bmp->pitches[0]) {
         /* SDL allocates a buffer smaller than requested if the video
          * overlay hardware is unable to support the requested size. */
         av_log(NULL, AV_LOG_FATAL,



More information about the ffmpeg-cvslog mailing list