summaryrefslogtreecommitdiffstats
path: root/libavcodec/sgidec.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2013-03-01 14:54:34 +0000
committerPaul B Mahol <onemda@gmail.com>2013-03-01 14:59:33 +0000
commit6c7d1608dd0cfcab99db2dd8fb0a00e410dd06b5 (patch)
tree0e7f8cef2f69ef15d76eac059a12dede152786d2 /libavcodec/sgidec.c
parentdc666d360b92f3e87d90c706a5258d2947f034f5 (diff)
downloadffmpeg-streaming-6c7d1608dd0cfcab99db2dd8fb0a00e410dd06b5.zip
ffmpeg-streaming-6c7d1608dd0cfcab99db2dd8fb0a00e410dd06b5.tar.gz
sgidec: use unchecked bytestream2 functions where it makes sense
Overreads can not happen as header size of 512 bytes is required. Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavcodec/sgidec.c')
-rw-r--r--libavcodec/sgidec.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/libavcodec/sgidec.c b/libavcodec/sgidec.c
index 555b504..51bd5d6 100644
--- a/libavcodec/sgidec.c
+++ b/libavcodec/sgidec.c
@@ -169,17 +169,17 @@ static int decode_frame(AVCodecContext *avctx,
}
/* Test for SGI magic. */
- if (bytestream2_get_be16(&s->g) != SGI_MAGIC) {
+ if (bytestream2_get_be16u(&s->g) != SGI_MAGIC) {
av_log(avctx, AV_LOG_ERROR, "bad magic number\n");
return AVERROR_INVALIDDATA;
}
- rle = bytestream2_get_byte(&s->g);
- s->bytes_per_channel = bytestream2_get_byte(&s->g);
- dimension = bytestream2_get_be16(&s->g);
- s->width = bytestream2_get_be16(&s->g);
- s->height = bytestream2_get_be16(&s->g);
- s->depth = bytestream2_get_be16(&s->g);
+ rle = bytestream2_get_byteu(&s->g);
+ s->bytes_per_channel = bytestream2_get_byteu(&s->g);
+ dimension = bytestream2_get_be16u(&s->g);
+ s->width = bytestream2_get_be16u(&s->g);
+ s->height = bytestream2_get_be16u(&s->g);
+ s->depth = bytestream2_get_be16u(&s->g);
if (s->bytes_per_channel != 1 && (s->bytes_per_channel != 2 || rle)) {
av_log(avctx, AV_LOG_ERROR, "wrong channel number\n");
OpenPOWER on IntegriCloud