Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(424)

Unified Diff: source/patched-ffmpeg-mt/libavcodec/pgssubdec.c

Issue 3384002: ffmpeg source update for sep 09 (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/ffmpeg/
Patch Set: Created 10 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « source/patched-ffmpeg-mt/libavcodec/pcx.c ('k') | source/patched-ffmpeg-mt/libavcodec/pictordec.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/patched-ffmpeg-mt/libavcodec/pgssubdec.c
===================================================================
--- source/patched-ffmpeg-mt/libavcodec/pgssubdec.c (revision 59334)
+++ source/patched-ffmpeg-mt/libavcodec/pgssubdec.c (working copy)
@@ -28,6 +28,7 @@
#include "dsputil.h"
#include "bytestream.h"
#include "libavutil/colorspace.h"
+#include "libavcore/imgutils.h"
//#define DEBUG_PACKET_CONTENTS
@@ -44,8 +45,6 @@
typedef struct PGSSubPresentation {
int x;
int y;
- int video_w;
- int video_h;
int id_number;
} PGSSubPresentation;
@@ -186,7 +185,7 @@
height = bytestream_get_be16(&buf);
/* Make sure the bitmap is not too large */
- if (ctx->presentation.video_w < width || ctx->presentation.video_h < height) {
+ if (avctx->width < width || avctx->height < height) {
av_log(avctx, AV_LOG_ERROR, "Bitmap dimensions larger then video.\n");
return -1;
}
@@ -266,11 +265,13 @@
int x, y;
uint8_t block;
- ctx->presentation.video_w = bytestream_get_be16(&buf);
- ctx->presentation.video_h = bytestream_get_be16(&buf);
+ int w = bytestream_get_be16(&buf);
+ int h = bytestream_get_be16(&buf);
dprintf(avctx, "Video Dimensions %dx%d\n",
- ctx->presentation.video_w, ctx->presentation.video_h);
+ w, h);
+ if (av_image_check_size(w, h, 0, avctx) >= 0)
+ avcodec_set_dimensions(avctx, w, h);
/* Skip 1 bytes of unknown, frame rate? */
buf++;
@@ -298,9 +299,9 @@
dprintf(avctx, "Subtitle Placement x=%d, y=%d\n", x, y);
- if (x > ctx->presentation.video_w || y > ctx->presentation.video_h) {
+ if (x > avctx->width || y > avctx->height) {
av_log(avctx, AV_LOG_ERROR, "Subtitle out of video bounds. x = %d, y = %d, video width = %d, video height = %d.\n",
- x, y, ctx->presentation.video_w, ctx->presentation.video_h);
+ x, y, avctx->width, avctx->height);
x = 0; y = 0;
}
« no previous file with comments | « source/patched-ffmpeg-mt/libavcodec/pcx.c ('k') | source/patched-ffmpeg-mt/libavcodec/pictordec.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698